Skip to content

Commit dcf6b88

Browse files
committed
start_directory for tmuxp freeze if all 3 panes equal
1 parent ccf978f commit dcf6b88

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

TODO

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ TODO
1717
it.
1818
- Handle case where switching client via ``$ tmuxp load`` or
1919
``$ tmuxp attach-session`` into another socket may cause an error.
20-
- Assure ``$ tmuxp freeze`` works with ``start_directory`` and does not
21-
return commands with dir and no CD's. (esp with zsh).
2220
- Fix issue where tmuxp freeze with exotic ``PS1``'s cause strange
2321
outputs.
2422
- If session name for ``$ tmuxp freeze`` has spaces, replace whitespace
@@ -44,6 +42,8 @@ Done
4442
- offer to save ``session_name`` as default file if filename
4543
doesn't already exist in config dir.
4644
- Remove -zsh command, python, etc if just in shell.
45+
- Assure ``$ tmuxp freeze`` works with ``start_directory`` and does not
46+
return commands with dir and no CD's. (esp with zsh).
4747

4848

4949
Future

tmuxp/workspacebuilder.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
from __future__ import absolute_import, division, print_function, with_statement
1515
import logging
16+
import os
1617
from . import exc, config, Window, Pane, Session, Server
1718

1819
logger = logging.getLogger(__name__)
@@ -242,12 +243,13 @@ def freeze(session):
242243
wconf['panes'] = []
243244

244245
if all(w.panes[0].get('pane_current_path') == p.get('pane_current_path') for p in w.panes):
245-
wconf['shell_command_before'] = w.panes[0].get('pane_current_path')
246+
wconf['start_directory'] = w.panes[0].get('pane_current_path')
246247

247248
for p in w.panes:
248249
pconf = {}
249250
pconf['shell_command'] = []
250-
if 'shell_command_before' not in wconf:
251+
252+
if not 'start_directory' in wconf:
251253
pconf['shell_command'].append(
252254
'cd ' + p.get('pane_current_path')
253255
)

0 commit comments

Comments
 (0)