Skip to content

Commit

Permalink
docs: Cleanup for command examples
Browse files Browse the repository at this point in the history
  • Loading branch information
tony committed Feb 17, 2024
1 parent 915fd19 commit b1657b9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ New session:
'libtmux...:2.0'
```

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

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

Magic, directly to a `Pane`:
Raw output directly to a `Pane`:

```python
>>> Pane.from_pane_id(pane_id=session.cmd('split-window', '-P', '-F#{pane_id}').stdout[0], server=session.server)
Expand Down
5 changes: 3 additions & 2 deletions docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ New session:
'libtmux...:2.0'
```

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

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

Magic, directly to a `Pane`:
Raw output directly to a `Pane` (in practice, you'd use {meth}`Session.split_window()`):

```python
>>> Pane.from_pane_id(pane_id=session.cmd('split-window', '-P', '-F#{pane_id}').stdout[0], server=session.server)
Expand Down
4 changes: 2 additions & 2 deletions src/libtmux/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def cmd(self, cmd: str, *args: t.Any) -> tmux_cmd:
>>> session.cmd('new-window', '-P').stdout[0]
'libtmux...:2.0'
Time for some tech, direct to a rich, `Window` object:
Output of `tmux -L ... new-window -P -F#{window_id}` to a `Window` object:
>>> Window.from_window_id(window_id=session.cmd(
... 'new-window', '-P', '-F#{window_id}').stdout[0], server=session.server)
Expand All @@ -200,7 +200,7 @@ def cmd(self, cmd: str, *args: t.Any) -> tmux_cmd:
>>> window.cmd('split-window', '-P', '-F#{pane_id}').stdout[0]
'%5'
Magic, directly to a `Pane`:
Output of `tmux -L ... split-window -P -F#{pane_id}` to a `Pane` object:
>>> Pane.from_pane_id(pane_id=session.cmd(
... 'split-window', '-P', '-F#{pane_id}').stdout[0], server=session.server)
Expand Down

0 comments on commit b1657b9

Please sign in to comment.