From 34f87a9be51efcaa7bebbe08decc217910d43fa0 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Thu, 21 Jul 2022 19:35:52 -0700 Subject: [PATCH] add ClearScrollback example that adds CTRL-L after clearing refs: https://github.com/wez/wezterm/issues/2290 --- docs/config/lua/keyassignment/ClearScrollback.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/config/lua/keyassignment/ClearScrollback.md b/docs/config/lua/keyassignment/ClearScrollback.md index 6af7d10e7..ef35d332a 100644 --- a/docs/config/lua/keyassignment/ClearScrollback.md +++ b/docs/config/lua/keyassignment/ClearScrollback.md @@ -14,6 +14,8 @@ local act = wezterm.action return { keys = { -- Clears only the scrollback and leaves the viewport intact. + -- You won't see a difference in what is on screen, you just won't + -- be able to scroll back until you've output more stuff on screen. -- This is the default behavior. { key = 'K', @@ -26,6 +28,16 @@ return { mods = 'CTRL|SHIFT', action = act.ClearScrollback 'ScrollbackAndViewport', }, + -- Clears the scrollback and viewport, and then sends CTRL-L to ask the + -- shell to redraw its prompt + { + key = 'K', + mods = 'CTRL|SHIFT', + action = act.Multiple { + act.ClearScrollback 'ScrollbackAndViewport', + act.SendKey { key = 'L', mods = 'CTRL' }, + }, + }, }, } ```