Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: zle - poor terminal echo on input line shortening



On Sun, Apr 7, 2019 at 4:47 PM Per Bothner <per@xxxxxxxxxxx> wrote:
>
> However, if you copy the line from some terminals (e.g. gnome-terminal), and paste
> (into say emacs) you get "echo foo   " with extra spaces.  That is because zle
> sends "\b \b" in response to the backspace.

ZLE is in most cases sending what the terminfo (termcap, curses)
library says will update the screen in the least number of transmitted
bytes.  In fact I don't think ZLE even explicitly defines that
sequence anywhere; if you delete 3 characters in the middle of a line
it'll still draw spaces on top of 3 characters at the end when
"repainting" everything to the right of the deletion.

> Both bash/readline and fish get this right because they instead send "\b\e[K".

Readline/fish don't have the $RPOMPT that (if present) would be erased
by "\e[K", among other things.



Messages sorted by: Reverse Date, Date, Thread, Author