Skip to content
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

Optionally disable shell history suppression #146

Merged
merged 4 commits into from
May 16, 2016

Conversation

kmactavish
Copy link
Contributor

This PR closes #144.

Adds the suppress_history option to override the default shell history suppression, for the workspace_builder only. The flag can be set at the session, window, or pane level, and defaults to True (the only existing option before this PR).

Documentation and examples have been added as well.

@coveralls
Copy link

coveralls commented May 12, 2016

Coverage Status

Coverage decreased (-0.04%) to 63.764% when pulling 67e9a2f on kmactavish:feature/suppress_bash_history into f0e5600 on tony:master.

@coveralls
Copy link

coveralls commented May 12, 2016

Coverage Status

Coverage increased (+0.2%) to 64.02% when pulling 1ae194f on kmactavish:feature/suppress_bash_history into f0e5600 on tony:master.

@kmactavish
Copy link
Contributor Author

After finishing this patch and digging through the code, I'm thinking that #46 was in fact a regression.

It was made so that non starting-shell-commands wouldn't spam the history, but should have stayed how it was for WorkspaceBuilder calls.

If that's the case, then this PR can be reduced to the suppress_history flag in send_keys that defaults to True, and hard-coding it to False in the WorkspaceBuilder.

@@ -75,7 +75,7 @@ def cmd(self, cmd, *args, **kwargs):

return self.server.cmd(cmd, *args, **kwargs)

def send_keys(self, cmd, enter=True):
def send_keys(self, cmd, enter=True, suppress_history=True):
"""``$ tmux send-keys`` to the pane.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docstring here would be nice too (it ends up showing in api docs)

@coveralls
Copy link

coveralls commented May 13, 2016

Coverage Status

Coverage increased (+0.2%) to 64.02% when pulling 4785b5c on kmactavish:feature/suppress_bash_history into f0e5600 on tony:master.

@@ -85,6 +85,8 @@ def send_keys(self, cmd, enter=True, suppress_history=True):
:type cmd: str
:param enter: Send enter after sending the input.
:type enter: bool
:param suppress_history: Don't add these keys to the shell history
:type suppress_history: bool
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@tony tony merged commit b409368 into tmux-python:master May 16, 2016
@kmactavish kmactavish deleted the feature/suppress_bash_history branch May 16, 2016 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Do output bash/zsh commands to history
4 participants