Codebase list tmuxp / 67e9a2f
Added session-level history suppression. Kirk MacTavish 8 years ago
4 changed file(s) with 45 addition(s) and 12 deletion(s). Raw diff Collapse all Expand all
240240 .. literalinclude:: ../examples/focus-window-and-panes.json
241241 :language: json
242242
243 Terminal History
244 ----------------
245
246 tmuxp allows ``suppress_history: false`` to override the default command /
247 suppression when building the workspace.
248 This will add the ``shell_command`` to the bash history in the pane.
249
250 YAML
251 ~~~~
252
253 .. literalinclude:: ../examples/suppress-history.yaml
254 :language: yaml
255
256 JSON
257 ~~~~
258
259 .. literalinclude:: ../examples/suppress-history.json
260 :language: json
261
243262 Window Index
244263 ------------
245264
11 "windows": [
22 {
33 "panes": [
4 "echo 'in the history!'"
4 "echo 'window in the history!'"
55 ],
66 "focus": true,
77 "suppress_history": false,
99 },
1010 {
1111 "panes": [
12 "echo 'not in the history!'"
12 "echo 'window not in the history!'"
1313 ],
1414 "suppress_history": true,
1515 "window_name": "suppressed"
1616 },
1717 {
1818 "panes": [
19 "echo 'default not in the history!'"
19 "echo 'session in the history!'"
2020 ],
2121 "window_name": "default"
2222 },
2323 {
2424 "panes": [
2525 {
26 "shell_command": "echo 'in the history!'",
26 "shell_command": "echo 'command in the history!'",
2727 "suppress_history": false
2828 },
2929 {
30 "shell_command": "echo 'not in the history!'",
30 "shell_command": "echo 'command not in the history!'",
3131 "suppress_history": true
3232 },
3333 {
34 "shell_command": "echo 'default not in the history!'"
34 "shell_command": "echo 'window not in the history!'"
3535 }
3636 ],
37 "suppress_history": true,
3738 "window_name": "mixed"
3839 }
3940 ],
41 "suppress_history": false,
4042 "session_name": "suppress"
4143 }
00 session_name: suppress
1 suppress_history: false
12 windows:
23 - window_name: appended
34 focus: true
45 suppress_history: false
56 panes:
6 - echo "in the history!"
7 - echo "window in the history!"
78
89 - window_name: suppressed
910 suppress_history: true
1011 panes:
11 - echo "not in the history!"
12 - echo "window not in the history!"
1213
1314 - window_name: default
1415 panes:
15 - echo "default not in the history!"
16 - echo "session in the history!"
1617
1718 - window_name: mixed
19 suppress_history: false
1820 panes:
1921 - shell_command:
20 - echo "in the history!"
22 - echo "command in the history!"
2123 suppress_history: false
2224 - shell_command:
23 - echo "not in the history!"
25 - echo "command not in the history!"
2426 suppress_history: true
2527 - shell_command:
26 - echo "default not in the history!"
28 - echo "window in the history!"
308308 else:
309309 session_start_directory = None
310310
311 if 'suppress_history' in sconf:
312 suppress_history = sconf['suppress_history']
313 else:
314 suppress_history = None
315
311316 for windowconfig in sconf['windows']:
312317
313318 # Prepend start_directory to relative window commands
324329 )
325330 windowconfig['start_directory'] = window_start_path
326331
332 # We only need to trickle to the window, workspace builder checks wconf
333 if suppress_history is not None:
334 if not 'suppress_history' in windowconfig:
335 windowconfig['suppress_history'] = suppress_history
336
327337 for paneconfig in windowconfig['panes']:
328338 commands_before = []
329339