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,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):