Files
LLeMbas-TTY/docs/config/lua/keyassignment/ClearScrollback.md
T
Dylan Frankland 88f44f5b5f Add erase mode to ClearScrollback action (#439)
* Add ClearBuffer action

Clears all lines, both visible and those scrolled off the top of the viewport, making the prompt line the new first line and resetting the scrollbar thumb to the full height of the window.

This is the behavior that Hyper / xterm has for clearing the terminal.

* Combine ClearBuffer into ClearScrollback as enum with associated erase mode

Makes it easier to manage the different options of clearing the terminal.
2021-01-25 21:26:23 -08:00

619 B

ClearScrollback

Clears the lines that have scrolled off the top of the viewport, resetting the scrollbar thumb to the full height of the window, and additionally the viewport depending on the argument:

return {
  keys = {
    -- Clears only the scrollback and leaves the viewport intact.
    -- This is the default behavior.
    {key="K", mods="CTRL|SHIFT", action=wezterm.action{ClearScrollback="ScrollbackOnly"}}
    -- Clears the scrollback and viewport leaving the prompt line the new first line.
    {key="K", mods="CTRL|SHIFT", action=wezterm.action{ClearScrollback="ScrollbackAndViewport"}}
  }
}