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,12 +26,16 @@ def capture_pane(pane_id=None):
|
|||
|
||||
def clear_pane(pane_id=None):
|
||||
"""Clear pane buffer for current or target pane."""
|
||||
cmd = ['tmux', 'send-keys', '-R']
|
||||
commands = [
|
||||
['tmux', 'send-keys', '-R'],
|
||||
['tmux', 'clear-history'],
|
||||
]
|
||||
if pane_id:
|
||||
cmd.extend(['-t', pane_id])
|
||||
commands = [[*cmd, '-t', pane_id] for cmd in commands]
|
||||
|
||||
# Clear pane
|
||||
run_program(cmd, check=False)
|
||||
for cmd in commands:
|
||||
run_program(cmd, check=False)
|
||||
|
||||
|
||||
def fix_layout(layout, forced=False):
|
||||
|
|
|
|||
Loading…
Reference in a new issue