You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[idea] scroll_on_clear: keep the cleared screen in scrollback on Ctrl+L, like tmux
#6010
Pressing Ctrl+L at a shell prompt erases the screenful that was showing and it never reaches scrollback. That screenful is usually the output I just ran and want to scroll back to.
This is separate from #2898, which asks herdr to ignore ESC[3J, the scrollback erase that clear sends. Ctrl+L sends only ESC[H ESC[2J in bash and zsh, so it never asks for scrollback to be erased. #5851 reports the same lost output. The reproduction is in #6009, which was closed as a request to preserve erased screen content and pointed here to Ideas.
requested change
A config flag that works like tmux's scroll-on-clear. The tmux man page describes it this way:
When the entire screen is cleared and this option is on, scroll the contents of the screen into history before clearing it.
For example:
[advanced]
scroll_on_clear = true
It applies only to ESC[2J on the primary screen.
ESC[3J still erases scrollback, so clear behaves as it does today.
The alternate screen is unchanged.
tmux turns it on by default, but off by default is fine with me, so nothing changes unless users set it.
why you want this
Terminals differ on this, so a flag lets each user choose. With the steps from #6009 and no herdr:
tmux 3.8 (on by default): rows kept in scrollback
iTerm2 3.7.7: rows kept in scrollback
Terminal.app: rows kept in scrollback
WezTerm 20240203: rows erased, the same as herdr today
For people coming from tmux, keeping the rows is the expected behavior as seen in #2898. My workaround in #2898 scrolls the screen away with newlines before sending Ctrl+L. It works, but it makes three herdr CLI calls on every key press, which adds a noticeable delay sometimes. herdr already has clear_pane for wiping scrollback (#545); this is the other side, keeping it.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
idea / problem
Pressing Ctrl+L at a shell prompt erases the screenful that was showing and it never reaches scrollback. That screenful is usually the output I just ran and want to scroll back to.
This is separate from #2898, which asks herdr to ignore
ESC[3J, the scrollback erase thatclearsends. Ctrl+L sends onlyESC[H ESC[2Jin bash and zsh, so it never asks for scrollback to be erased. #5851 reports the same lost output. The reproduction is in #6009, which was closed as a request to preserve erased screen content and pointed here to Ideas.requested change
A config flag that works like tmux's
scroll-on-clear. The tmux man page describes it this way:For example:
ESC[2Jon the primary screen.ESC[3Jstill erases scrollback, soclearbehaves as it does today.why you want this
Terminals differ on this, so a flag lets each user choose. With the steps from #6009 and no herdr:
For people coming from tmux, keeping the rows is the expected behavior as seen in #2898. My workaround in #2898 scrolls the screen away with newlines before sending Ctrl+L. It works, but it makes three herdr CLI calls on every key press, which adds a noticeable delay sometimes. herdr already has
clear_panefor wiping scrollback (#545); this is the other side, keeping it.All reactions