File tree Expand file tree Collapse file tree 5 files changed +76
-3
lines changed Expand file tree Collapse file tree 5 files changed +76
-3
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,14 @@ See: `Quickstart`_
3535CLI Commands
3636""""""""""""
3737
38+ ==========================
39+
40+ ``tmuxp attach-session ``
41+ ``tmuxp kill-session ``
42+ ``tmuxp convert ``
43+ ``tmuxp import ``
44+ ``tmuxp import ``
45+
3846tmuxp uses ``switch-client `` for you if already in a TMUX client.
3947
4048.. code-block :: bash
Original file line number Diff line number Diff line change 44Examples
55========
66
7+ Short hand / inline
8+ -------------------
9+
10+ .. sidebar :: short hand
11+
12+ .. aafig ::
13+
14+ +-----------------+
15+ | $ |
16+ | |
17+ +-----------------+
18+ | $ |
19+ | |
20+ +-----------------+
21+ | $ |
22+ +-----------------+
23+
24+ YAML
25+ """"
26+
27+ .. literalinclude :: ../examples/shorthands.yaml
28+ :language: yaml
29+
30+ JSON
31+ """"
32+
33+ .. literalinclude :: ../examples/shorthands.json
34+ :language: json
35+
7362 split panes
837-------------
938
Original file line number Diff line number Diff line change 1+ {
2+ "windows" : [
3+ {
4+ "panes" : [
5+ {
6+ "shell_command" : [
7+ " echo 'did you know'" ,
8+ " echo 'you can inline'"
9+ ]
10+ },
11+ {
12+ "shell_command" : " echo 'single commands'"
13+ },
14+ " echo 'for panes'"
15+ ],
16+ "window_name" : " long form"
17+ }
18+ ],
19+ "session_name" : " shorthands"
20+ }
Original file line number Diff line number Diff line change 1+ session_name : shorthands
2+ windows :
3+ - window_name : long form
4+ panes :
5+ - shell_command :
6+ - echo 'did you know'
7+ - echo 'you can inline'
8+ - shell_command : echo 'single commands'
9+ - echo 'for panes'
Original file line number Diff line number Diff line change @@ -155,9 +155,16 @@ def expand(config):
155155
156156 # recurse into window and pane config items
157157 if 'windows' in config :
158- config ['windows' ] = [expand (window )
159- for window in config ['windows' ]]
160- if 'panes' in config :
158+ config ['windows' ] = [
159+ expand (window ) for window in config ['windows' ]
160+ ]
161+ elif 'panes' in config :
162+ for p in config ['panes' ]:
163+ if isinstance (p , basestring ):
164+ p_index = config ['panes' ].index (p )
165+ config ['panes' ][p_index ] = {
166+ 'shell_command' : [p ]
167+ }
161168 config ['panes' ] = [expand (pane ) for pane in config ['panes' ]]
162169
163170 return config
You can’t perform that action at this time.
0 commit comments