Skip to content

Commit f15027f

Browse files
committed
docs: Cleanup for command examples
1 parent 915fd19 commit f15027f

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

README.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ New session:
8888
'libtmux...:2.0'
8989
```
9090

91-
Time for some tech, direct to a rich, `Window` object:
91+
From raw command output, to a rich `Window` object (in practice and as shown
92+
later, you'd use `Session.new_window()`):
9293

9394
```python
9495
>>> Window.from_window_id(window_id=session.cmd('new-window', '-P', '-F#{window_id}').stdout[0], server=session.server)
@@ -102,10 +103,10 @@ Create a pane from a window:
102103
'%2'
103104
```
104105

105-
Magic, directly to a `Pane`:
106+
Raw output directly to a `Pane`:
106107

107108
```python
108-
>>> Pane.from_pane_id(pane_id=session.cmd('split-window', '-P', '-F#{pane_id}').stdout[0], server=session.server)
109+
>>> Pane.from_pane_id(pane_id=window.cmd('split-window', '-P', '-F#{pane_id}').stdout[0], server=window.server)
109110
Pane(%... Window(@1 1:..., Session($1 libtmux_...)))
110111
```
111112

docs/quickstart.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,8 @@ New session:
134134
'libtmux...:2.0'
135135
```
136136

137-
Time for some tech, direct to a rich, `Window` object:
137+
From raw command output, to a rich {class}`Window` object (in practice and as shown
138+
later, you'd use {meth}`Session.new_window()`):
138139

139140
```python
140141
>>> Window.from_window_id(window_id=session.cmd('new-window', '-P', '-F#{window_id}').stdout[0], server=session.server)
@@ -148,10 +149,10 @@ Create a pane from a window:
148149
'%2'
149150
```
150151

151-
Magic, directly to a `Pane`:
152+
Raw output directly to a {class}`Pane` (in practice, you'd use {meth}`Window.split_window()`):
152153

153154
```python
154-
>>> Pane.from_pane_id(pane_id=session.cmd('split-window', '-P', '-F#{pane_id}').stdout[0], server=session.server)
155+
>>> Pane.from_pane_id(pane_id=window.cmd('split-window', '-P', '-F#{pane_id}').stdout[0], server=window.server)
155156
Pane(%... Window(@1 1:..., Session($1 libtmux_...)))
156157
```
157158

src/libtmux/server.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ def cmd(self, cmd: str, *args: t.Any) -> tmux_cmd:
189189
>>> session.cmd('new-window', '-P').stdout[0]
190190
'libtmux...:2.0'
191191
192-
Time for some tech, direct to a rich, `Window` object:
192+
Output of `tmux -L ... new-window -P -F#{window_id}` to a `Window` object:
193193
194194
>>> Window.from_window_id(window_id=session.cmd(
195195
... 'new-window', '-P', '-F#{window_id}').stdout[0], server=session.server)
@@ -200,10 +200,10 @@ def cmd(self, cmd: str, *args: t.Any) -> tmux_cmd:
200200
>>> window.cmd('split-window', '-P', '-F#{pane_id}').stdout[0]
201201
'%5'
202202
203-
Magic, directly to a `Pane`:
203+
Output of `tmux -L ... split-window -P -F#{pane_id}` to a `Pane` object:
204204
205-
>>> Pane.from_pane_id(pane_id=session.cmd(
206-
... 'split-window', '-P', '-F#{pane_id}').stdout[0], server=session.server)
205+
>>> Pane.from_pane_id(pane_id=window.cmd(
206+
... 'split-window', '-P', '-F#{pane_id}').stdout[0], server=window.server)
207207
Pane(%... Window(@... ...:..., Session($1 libtmux_...)))
208208
209209
Returns

0 commit comments

Comments
 (0)