Clear history when clearing a pane
Helpful if the pane is resized to prevent cleared lines from returning.
This commit is contained in:
parent
9678f143c7
commit
ba69773fba
1 changed files with 7 additions and 3 deletions
|
|
@ -26,11 +26,15 @@ def capture_pane(pane_id=None):
|
||||||
|
|
||||||
def clear_pane(pane_id=None):
|
def clear_pane(pane_id=None):
|
||||||
"""Clear pane buffer for current or target pane."""
|
"""Clear pane buffer for current or target pane."""
|
||||||
cmd = ['tmux', 'send-keys', '-R']
|
commands = [
|
||||||
|
['tmux', 'send-keys', '-R'],
|
||||||
|
['tmux', 'clear-history'],
|
||||||
|
]
|
||||||
if pane_id:
|
if pane_id:
|
||||||
cmd.extend(['-t', pane_id])
|
commands = [[*cmd, '-t', pane_id] for cmd in commands]
|
||||||
|
|
||||||
# Clear pane
|
# Clear pane
|
||||||
|
for cmd in commands:
|
||||||
run_program(cmd, check=False)
|
run_program(cmd, check=False)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue