Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions examples/blank-panes.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,17 @@
}
],
"window_name": "Empty string (return)"
},
{
"panes": [
{
"focus": true
},
{
"start_directory": "/tmp"
}
],
"window_name": "Blank with options"
}
],
"session_name": "Blank pane test"
Expand Down
5 changes: 5 additions & 0 deletions examples/blank-panes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,8 @@ windows:
- shell_command: ''
- shell_command:
- ''
# a pane can have other options but still be blank
- window_name: Blank with options
panes:
- focus: true
- start_directory: /tmp
3 changes: 2 additions & 1 deletion tmuxp/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ def expand(sconf, cwd=None):
}

assert isinstance(p, dict)
assert 'shell_command' in p
if 'shell_command' in p:
cmd = p['shell_command']

Expand All @@ -224,6 +223,8 @@ def expand(sconf, cwd=None):
cmd = []

p['shell_command'] = cmd
else:
p['shell_command'] = []

pconf.update(p)
sconf['panes'] = [expand(pane) for pane in sconf['panes']]
Expand Down
13 changes: 13 additions & 0 deletions tmuxp/testsuite/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -947,6 +947,19 @@ class ConfigBlankPanes(TestCase):
],
}
]
},
{
'window_name': 'Blank with options',
'panes': [
{
'shell_command': [],
'focus': True,
},
{
'shell_command': [],
'start_directory': '/tmp',
}
]
}
]
}
Expand Down
3 changes: 3 additions & 0 deletions tmuxp/testsuite/workspacebuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,9 @@ def test_blank_pane_count(self):
)
self.assertEqual(len(window3._panes), 3)

window4 = self.session.findWhere({'window_name': 'Blank with options'})
self.assertEqual(len(window4._panes), 2)


class StartDirectoryTest(TmuxTestCase):
yaml_config = """
Expand Down