Skip to content

Commit

Permalink
docs(quickstart): Update suppress_history docs (fixes #403)
Browse files Browse the repository at this point in the history
  • Loading branch information
tony committed Aug 22, 2022
1 parent 83a9f9c commit 9a0f9d0
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,6 @@ can also use the `.select_*` available on the object, in this case the pane has

## Sending commands to tmux panes remotely

You may send commands to panes, windows and sessions **without** them being visible.
As long as you have the object, or are iterating through a list of them, you can use `.send_keys`.

```python
Expand All @@ -334,8 +333,8 @@ As long as you have the object, or are iterating through a list of them, you can
>>> pane.send_keys('echo hey', enter=False)
```

See the other window, notice that {meth}`Pane.send_keys` has " `echo hey`" written,
_still in the prompt_. Note the leading space character so the command won't be added to the user's history. Use {}`pane.cmd('send-keys', text)` to send keys without this leading space.
See the other window, notice that {meth}`Pane.send_keys` has "`echo hey`" written,
_still in the prompt_.

`enter=False` can be used to send keys without pressing return. In this case,
you may leave it to the user to press return himself, or complete a command
Expand All @@ -345,6 +344,20 @@ using {meth}`Pane.enter()`:
>>> pane.enter()
```

### Avoid cluttering shell history

`suppress_history=True` can send commands to pane windows and sessions **without**
them being visible in the history.

```python
>>> pane.send_keys('echo Howdy', enter=True, suppress_history=True)
```

In this case, {meth}`Pane.send_keys` has " `echo hey`" written,
automatically sent, the leading space character prevents adding it to the user's
shell history. Omitting `enter=false` means the default behavior (sending the
command) is done, without needing to use `pane.enter()` after.

## Final notes

These objects created use tmux's internal usage of ID's to make servers,
Expand Down

0 comments on commit 9a0f9d0

Please sign in to comment.