File tree Expand file tree Collapse file tree 3 files changed +14
-5
lines changed Expand file tree Collapse file tree 3 files changed +14
-5
lines changed Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff 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
4648Python 3.7+ supports ` PEP 553` _ ``breakpoint ()` ` (including
4749` ` PYTHONBREAKPOINT` ` ). Also supports direct commands via ` ` -c` ` :
Original file line number Diff line number Diff line change 4040Launch into a python console with `libtmux `_ objects. Compare to django's shell.
4141
4242Automatically 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
6264Python 3.7 supports `PEP 553 `_'s ``PYTHONBREAKPOINT `` and supports
6365compatible 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
You can’t perform that action at this time.
0 commit comments