From b0d227a7c0ea41e32f89539d46f555dc564a6b21 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Fri, 5 Aug 2022 19:52:07 -0500 Subject: [PATCH 1/2] refactor!(Pane.send_keys): Default suppress_history value to False --- libtmux/pane.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/libtmux/pane.py b/libtmux/pane.py index 191dadeb0..1e05d0549 100644 --- a/libtmux/pane.py +++ b/libtmux/pane.py @@ -130,7 +130,7 @@ def send_keys( self, cmd: str, enter: t.Optional[bool] = True, - suppress_history: t.Optional[bool] = True, + suppress_history: t.Optional[bool] = False, literal: t.Optional[bool] = False, ) -> None: r"""``$ tmux send-keys`` to the pane. @@ -145,7 +145,11 @@ def send_keys( enter : bool, optional Send enter after sending the input, default True. suppress_history : bool, optional - Don't add these keys to the shell history, default True. + Prepend a space to command to suppress shell history, default False. + + .. versionchanged:: 0.14 + + Default changed from True to False. literal : bool, optional Send keys literally, default True. @@ -155,7 +159,7 @@ def send_keys( >>> pane.capture_pane() ['$'] - >>> pane.send_keys('echo "Hello world"', suppress_history=False, enter=True) + >>> pane.send_keys('echo "Hello world"', enter=True) >>> pane.capture_pane() ['$ echo "Hello world"', 'Hello world', '$'] From 605e8038faa9fdd53f1e62d5e51db3ed569c7b47 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Fri, 5 Aug 2022 19:54:05 -0500 Subject: [PATCH 2/2] docs(CHANGES): Note send_keys default value change --- CHANGES | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGES b/CHANGES index 658479269..b7e5370eb 100644 --- a/CHANGES +++ b/CHANGES @@ -12,6 +12,11 @@ $ pip install --user --upgrade --pre libtmux - _Insert changes/features/fixes for next release here_ +### Breaking changes + +- `Pane.send_keys`: `suppress_history` default value changed from `True` to + `False` + ### Tests and docs - Initial [doctests] examples stubbed out {issue}`#394`