File tree 3 files changed +14
-5
lines changed
3 files changed +14
-5
lines changed Original file line number Diff line number Diff line change 9
9
- *Insert changes/features/fixes for next release here *
10
10
- :issue: `636 ` New command: ``tmuxp shell ``
11
11
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 .
14
14
15
15
In python 3.7+, supports ``PYTHONBREAKPOINT ``:
16
16
Original file line number Diff line number Diff line change @@ -42,6 +42,8 @@ session, and window in `libtmux`_ objects.
42
42
' your_window'
43
43
(Pdb) window.panes
44
44
[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))
45
47
46
48
Python 3.7+ supports ` PEP 553` _ ``breakpoint ()` ` (including
47
49
` ` PYTHONBREAKPOINT` ` ). Also supports direct commands via ` ` -c` ` :
Original file line number Diff line number Diff line change 40
40
Launch into a python console with `libtmux `_ objects. Compare to django's shell.
41
41
42
42
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::
46
46
47
47
(Pdb) server
48
48
<libtmux.server.Server object at 0x7f7dc8e69d10>
@@ -58,6 +58,8 @@ choice::
58
58
'your_window'
59
59
(Pdb) window.panes
60
60
[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)))
61
63
62
64
Python 3.7 supports `PEP 553 `_'s ``PYTHONBREAKPOINT `` and supports
63
65
compatible debuggers, for instance `ipdb `_:
@@ -87,6 +89,11 @@ this via ``tmuxp -c``:
87
89
$ tmuxp shell my_server my_window -c ' print(window.name.upper())'
88
90
MY_WINDOW
89
91
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
+
90
97
.. _PEP 553 : https://www.python.org/dev/peps/pep-0553/
91
98
.. _ipdb : https://pypi.org/project/ipdb/
92
99
.. _libtmux : https://libtmux.git-pull.com
You can’t perform that action at this time.
0 commit comments