File tree Expand file tree Collapse file tree 2 files changed +23
-5
lines changed
Expand file tree Collapse file tree 2 files changed +23
-5
lines changed Original file line number Diff line number Diff line change @@ -236,6 +236,24 @@ def test_trickle_relative_start_directory():
236236 assert test_config == fixtures .trickle .expected
237237
238238
239+ def test_trickle_window_with_no_pane_config ():
240+ test_yaml = """
241+ session_name: test_session
242+ windows:
243+ - window_name: test_1
244+ panes:
245+ - shell_command:
246+ - ls -l
247+ - window_name: test_no_panes
248+ """
249+ sconfig = load_yaml (test_yaml )
250+ config .validate_schema (sconfig )
251+
252+ assert config .expand (config .trickle (sconfig ))['windows' ][1 ]['panes' ][0 ] == {
253+ 'shell_command' : []
254+ }
255+
256+
239257def test_expands_blank_panes ():
240258 """Expand blank config into full form.
241259
Original file line number Diff line number Diff line change @@ -42,11 +42,6 @@ def validate_schema(sconf):
4242 if 'window_name' not in window :
4343 raise exc .ConfigError ('config window is missing "window_name"' )
4444
45- if 'panes' not in window :
46- raise exc .ConfigError (
47- 'config window %s requires list of panes' % window ['window_name' ]
48- )
49-
5045 return True
5146
5247
@@ -370,6 +365,11 @@ def trickle(sconf):
370365 if 'suppress_history' not in windowconfig :
371366 windowconfig ['suppress_history' ] = suppress_history
372367
368+ # If panes were NOT specified for a window, assume that a single pane
369+ # with no shell commands is desired
370+ if 'panes' not in windowconfig :
371+ windowconfig ['panes' ] = [{'shell_command' : []}]
372+
373373 for paneconfig in windowconfig ['panes' ]:
374374 commands_before = []
375375
You can’t perform that action at this time.
0 commit comments