@@ -120,10 +120,44 @@ equivalent to `$ tmux -L mysocket`.
120
120
` server ` is now a living object bound to the tmux server's Sessions,
121
121
Windows and Panes.
122
122
123
+ ## Raw, contextual commands
124
+
125
+ New session:
126
+
127
+ ``` python
128
+ >> > server.cmd(' new-session' , ' -d' , ' -P' , ' -F#{session_id} ' ).stdout[0 ]
129
+ ' $2'
130
+ ```
131
+
132
+ ``` python
133
+ >> > session.cmd(' new-window' , ' -P' ).stdout[0 ]
134
+ ' libtmux...:2.0'
135
+ ```
136
+
137
+ Time for some tech, direct to a rich, ` Window ` object:
138
+
139
+ ``` python
140
+ >> > Window.from_window_id(window_id = session.cmd(' new-window' , ' -P' , ' -F#{window_id} ' ).stdout[0 ], server = session.server)
141
+ Window(@ 2 2 :... , Session($ 1 libtmux_... ))
142
+ ```
143
+
144
+ Create a pane from a window:
145
+
146
+ ``` python
147
+ >> > window.cmd(' split-window' , ' -P' , ' -F#{pane_id} ' ).stdout[0 ]
148
+ ' %2'
149
+ ```
150
+
151
+ Magic, directly to a ` Pane ` :
152
+
153
+ ``` python
154
+ >> > Pane.from_pane_id(pane_id = session.cmd(' split-window' , ' -P' , ' -F#{pane_id} ' ).stdout[0 ], server = session.server)
155
+ Pane(% ... Window(@ 1 1 :... , Session($ 1 libtmux_... )))
156
+ ```
157
+
123
158
## Find your {class}` Session `
124
159
125
- If you have multiple tmux sessions open, you can see that all of the
126
- methods in {class}` Server ` are available.
160
+ If you have multiple tmux sessions open, all methods in {class}` Server ` are available.
127
161
128
162
We can list sessions with {meth}` Server.sessions ` :
129
163
0 commit comments