-
Notifications
You must be signed in to change notification settings - Fork 231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new-window command functionality #145
Merged
Merged
Changes from 2 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
f4aef07
Add new-window command functionality
ikirudennis 8a3cff8
add test for WorkSpaceBuilder window_command option.
ikirudennis 1c4dd17
Initial commit of bash history suppression w/ example.
kmactavish 67e9a2f
Added session-level history suppression.
kmactavish 1ae194f
Added unit test for suppress history
kmactavish 4785b5c
Adding docstring for suppress_history to send_keys
kmactavish b438c3b
add missing docstrings to Session.new_window
ikirudennis adadab5
change window_command to window_shell
ikirudennis 2079cd1
fix tests.
ikirudennis b409368
Merge pull request #146 from kmactavish/feature/suppress_bash_history
tony 75a78f0
modify testing
ikirudennis 7eb9441
whoops.
ikirudennis f137014
Add new-window command functionality
ikirudennis ae4e55d
add test for WorkSpaceBuilder window_command option.
ikirudennis 9485bf8
add missing docstrings to Session.new_window
ikirudennis 84cdf34
change window_command to window_shell
ikirudennis 967e25e
fix tests.
ikirudennis e914508
modify testing
ikirudennis a5fc28f
whoops.
ikirudennis a0ad82f
Merge branch 'new-window-command' of github.com:ikirudennis/tmuxp int…
ikirudennis e015b71
rebase against master and add modification from @tony.
ikirudennis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -253,6 +253,31 @@ def test_window_options(self): | |
window_count += 1 | ||
w.select_layout(wconf['layout']) | ||
|
||
def test_window_command(self): | ||
yaml_config = """ | ||
session_name: test window options | ||
start_directory: '~' | ||
windows: | ||
- layout: main-horizontal | ||
options: | ||
main-pane-height: 5 | ||
panes: | ||
- pane | ||
- pane | ||
- pane | ||
window_name: editor | ||
window_command: test_command | ||
""" | ||
s = self.session | ||
sconfig = kaptan.Kaptan(handler='yaml') | ||
sconfig = sconfig.import_config(yaml_config).get() | ||
sconfig = config.expand(sconfig) | ||
|
||
builder = WorkspaceBuilder(sconf=sconfig) | ||
|
||
wc_config = builder.sconf.get('windows')[0].get('window_command') | ||
self.assertEqual(wc_config, 'test_command') | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These are intended to be integration tests in the truest sense of the word. See We have a minimum tmux version we officially support (though we can bump it of course). I'd like to be sure that this behavior would work on older versions. Try something like this: diff --git a/tmuxp/testsuite/workspacebuilder.py b/tmuxp/testsuite/workspacebuilder.py
index 253834e..a8b79dc 100644
--- a/tmuxp/testsuite/workspacebuilder.py
+++ b/tmuxp/testsuite/workspacebuilder.py
@@ -266,7 +266,7 @@ class WindowOptions(TmuxTestCase):
- pane
- pane
window_name: editor
- window_shell: test_command
+ window_shell: top
"""
s = self.session
sconfig = kaptan.Kaptan(handler='yaml')
@@ -277,7 +277,14 @@ class WindowOptions(TmuxTestCase):
for w, wconf in builder.iter_create_windows(s):
if 'window_shell' in wconf:
- self.assertEqual(wconf['window_shell'], text_type('test_command'))
+ self.assertEqual(wconf['window_shell'], text_type('top'))
+ for i in range(10):
+ self.session.server._update_windows()
+ if w['window_name'] != 'top':
+ break
+ time.sleep(.2)
+
+ self.assertNotEqual(w.get('window_name'), text_type('top'))
class EnvironmentVariables(TmuxTestCase):
@@ -305,7 +312,7 @@ class EnvironmentVariables(TmuxTestCase):
self.assertEqual('BAR', self.session.show_environment('FOO'))
self.assertEqual('/tmp', self.session.show_environment('PATH'))
-
+
class WindowAutomaticRename(TmuxTestCase):
yaml_config = """ |
||
|
||
class EnvironmentVariables(TmuxTestCase): | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add the docstrings (
:param window_index: description
, so on) for these params?