Clear history when clearing a pane

Helpful if the pane is resized to prevent cleared lines from returning.
This commit is contained in:
2Shirt 2023-05-27 19:08:48 -07:00
parent 9678f143c7
commit ba69773fba
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C

View file

@ -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)