Skip to content

Commit 9a0f9d0

Browse files
committed
docs(quickstart): Update suppress_history docs (fixes #403)
1 parent 83a9f9c commit 9a0f9d0

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

docs/quickstart.md

+16-3
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,6 @@ can also use the `.select_*` available on the object, in this case the pane has
325325

326326
## Sending commands to tmux panes remotely
327327

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

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

337-
See the other window, notice that {meth}`Pane.send_keys` has " `echo hey`" written,
338-
_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.
336+
See the other window, notice that {meth}`Pane.send_keys` has "`echo hey`" written,
337+
_still in the prompt_.
339338

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

347+
### Avoid cluttering shell history
348+
349+
`suppress_history=True` can send commands to pane windows and sessions **without**
350+
them being visible in the history.
351+
352+
```python
353+
>>> pane.send_keys('echo Howdy', enter=True, suppress_history=True)
354+
```
355+
356+
In this case, {meth}`Pane.send_keys` has " `echo hey`" written,
357+
automatically sent, the leading space character prevents adding it to the user's
358+
shell history. Omitting `enter=false` means the default behavior (sending the
359+
command) is done, without needing to use `pane.enter()` after.
360+
348361
## Final notes
349362

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

0 commit comments

Comments
 (0)