Skip to content

Commit cefd802

Browse files
committed
Update docs for tmuxp shell's pane object
1 parent 5e1ead8 commit cefd802

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

CHANGES

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ current
99
- *Insert changes/features/fixes for next release here*
1010
- :issue:`636` New command: ``tmuxp shell``
1111

12-
Accepts tmux socket_name/socket_path, automatically uses the current
13-
tmux session and window and makes them available in pdb context.
12+
Automatically preloads session, window, and pane via `libtmux`_
13+
api objects and makes them available in a python console.
1414

1515
In python 3.7+, supports ``PYTHONBREAKPOINT``:
1616

README.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ session, and window in `libtmux`_ objects.
4242
'your_window'
4343
(Pdb) window.panes
4444
[Pane(%6 Window(@3 1:your_window, Session($1 your_project)))
45+
(Pdb) pane
46+
Pane(%6 Window(@3 1:your_window, Session($1 your_project))
4547
4648
Python 3.7+ supports `PEP 553`_ ``breakpoint()`` (including
4749
``PYTHONBREAKPOINT``). Also supports direct commands via ``-c``:

docs/cli.rst

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ Shell
4040
Launch into a python console with `libtmux`_ objects. Compare to django's shell.
4141

4242
Automatically will picked the current tmux :class:`server <libtmux.Server>`,
43-
:class:`session <libtmux.Session>`, and :class:`window <libtmux.Window>` you
44-
are currently in. Pass additional arguments to select a specific one of your
45-
choice::
43+
:class:`session <libtmux.Session>`, :class:`window <libtmux.Window>`
44+
:class:`pane <libtmux.Pane>` you are currently in. Pass additional arguments
45+
to select a specific one of your choice::
4646

4747
(Pdb) server
4848
<libtmux.server.Server object at 0x7f7dc8e69d10>
@@ -58,6 +58,8 @@ choice::
5858
'your_window'
5959
(Pdb) window.panes
6060
[Pane(%6 Window(@3 1:your_window, Session($1 your_project)))
61+
(Pdb) pane
62+
Pane(%6 Window(@3 1:your_window, Session($1 your_project)))
6163

6264
Python 3.7 supports `PEP 553`_'s ``PYTHONBREAKPOINT`` and supports
6365
compatible debuggers, for instance `ipdb`_:
@@ -87,6 +89,11 @@ this via ``tmuxp -c``:
8789
$ tmuxp shell my_server my_window -c 'print(window.name.upper())'
8890
MY_WINDOW
8991
92+
# Assuming inside a tmux pane or one is attached on default server
93+
$ tmuxp shell -c 'print(pane.id); print(pane.window.name)'
94+
%2
95+
my_window
96+
9097
.. _PEP 553: https://www.python.org/dev/peps/pep-0553/
9198
.. _ipdb: https://pypi.org/project/ipdb/
9299
.. _libtmux: https://libtmux.git-pull.com

0 commit comments

Comments
 (0)