[konsole] [Bug 427577] Ctrl+Shift+K (Clear Scrollback and Reset) causes TTY to report incorrect size
Justin Zobel
bugzilla_noreply at kde.org
Thu Oct 29 07:03:53 GMT 2020
https://bugs.kde.org/show_bug.cgi?id=427577
Justin Zobel <justin.zobel at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|REPORTED |NEEDSINFO
Resolution|--- |WAITINGFORINFO
CC| |justin.zobel at gmail.com
--- Comment #4 from Justin Zobel <justin.zobel at gmail.com> ---
(In reply to Roman Perepelitsa from comment #3)
> Thanks for the context.
>
> This hack causes issues when the content of prompt depends on the terminal
> dimensions. Here's an example:
>
> PROMPT=$'${(pl.$((COLUMNS))..-.)}\n> ' zsh -f --promptsubst
>
> If you run this command in Konsole and press Ctrl+Shift+K, you'll see a
> duplicate line at the top.
>
> This problem would be avoided if Ctr+Shift+K cleared scrollback and sent
> `^L` to the shell. This solution would rely on the shell being able to
> redraw its prompt upon receiving `^L`, which is not guaranteed in general.
> On the other hand, it's also not guaranteed that the shell redraws its
> prompt upon receiving SIGWINCH.
>
> FWIW, Clear Scrollback and Reset can be implemented in Zsh in
> terminal-agnostic manner.
>
> function clear-screen-and-scrollback() { printf '\e[3J' >$TTY && zle
> clear-screen }
> zle -N clear-screen-and-scrollback
> # Ctrl+Alt+k -- Clear Scrollback and Reset.
> bindkey '^[^k' clear-screen-and-scrollback
Roman would you be interested in supplying a patch to make the hack cleaner and
work in all scenarios?
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the konsole-devel
mailing list