https://bugs.kde.org/show_bug.cgi?id=427577

Justin Zobel <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REPORTED                    |NEEDSINFO
         Resolution|---                         |WAITINGFORINFO
                 CC|                            |[email protected]

--- Comment #4 from Justin Zobel <[email protected]> ---
(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 watching all bug changes.

Reply via email to