Skip to content

Commit 10a29ad

Browse files
committed
Merge pull request #94 from thomasballinger/document-send-keys-leading-space
document added leading space in Pane.send_keys
2 parents 542044b + 9b3e2e5 commit 10a29ad

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

doc/quickstart_python.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -346,11 +346,13 @@ As long as you have the object, or are iterating through a list of them, you can
346346
>>> pane = window.split_window(attach=False)
347347
>>> pane.send_keys('echo hey', enter=False)
348348
349-
See the other window, notice that :meth:`Pane.send_keys` has ``echo hey`` written,
350-
*still in the prompt*.
349+
See the other window, notice that :meth:`Pane.send_keys` has " ``echo hey``" written,
350+
*still in the prompt*. Note the leading space character so the command won't be added
351+
to the user's history. Use `pane.tmux('send-keys', text)` to send keys without this
352+
leading space.
351353

352354
``enter=False`` can be used to send keys without pressing return. In this case,
353-
you may leave it to the user to press return themselves, or complete a command
355+
you may leave it to the user to press return themselves, or complete a command
354356
using :meth:`Pane.enter()`:
355357

356358
.. code-block:: python

tmuxp/pane.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ def tmux(self, cmd, *args, **kwargs):
7575
def send_keys(self, cmd, enter=True):
7676
"""``$ tmux send-keys`` to the pane.
7777
78+
A leading space character is added to cmd to avoid polluting the
79+
user's history.
80+
7881
:param cmd: Text or input into pane
7982
:type cmd: str
8083
:param enter: Send enter after sending the input.

0 commit comments

Comments
 (0)