@@ -265,12 +265,14 @@ def freeze(session):
265265 wconf ['layout' ] = w .get ('window_layout' )
266266 wconf ['panes' ] = []
267267
268- if (
269- all (
270- w .panes [0 ].get ('pane_current_path' ) ==
271- p .get ('pane_current_path' ) for p in w .panes
272- )
273- ):
268+ # If all panes have same path, set 'start_directory' instead
269+ # of using 'cd' shell commands.
270+ pane_has_same_path = lambda p : (
271+ w .panes [0 ].get ('pane_current_path' ) ==
272+ p .get ('pane_current_path' )
273+ )
274+
275+ if (all (pane_has_same_path (p ) for p in w .panes )):
274276 wconf ['start_directory' ] = w .panes [0 ].get ('pane_current_path' )
275277
276278 for p in w .panes :
@@ -284,14 +286,17 @@ def freeze(session):
284286
285287 current_cmd = p .get ('pane_current_command' )
286288
287- if (
288- current_cmd .startswith ('-' ) or
289- any (
290- current_cmd .endswith (cmd )
291- for cmd in ['python' , 'ruby' , 'node' ]
289+ def filter_interpretters_and_shells ():
290+ return (
291+ current_cmd .startswith ('-' ) or
292+ any (
293+ current_cmd .endswith (cmd )
294+ for cmd in ['python' , 'ruby' , 'node' ]
295+ )
292296 )
293- ):
294- current_cmd = None
297+
298+ if (filter_interpretters_and_shells ()):
299+ current_cmd = None
295300
296301 if current_cmd :
297302 pconf ['shell_command' ].append (current_cmd )
0 commit comments