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

zle - poor terminal echo on input line shortening



[I am not on the zsh-workers list, so please cc me on any responses.]

Consider typing an input line like 'echo foobar' and then deleting the last 3
characters (by backspacing).  That logically and visually yields "echo foo".
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.  Some terminals keep track of the
maximum number of characters written to a line so they can distinguish explicit
space from "non-written" padding.

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

This also show up in different colors/styling on the DomTerm terminal emulator
(https://domterm.org) because it sets a special css style for the actual input line.

Of course this is a very minor issue ...
--
	--Per Bothner
per@xxxxxxxxxxx   http://per.bothner.com/



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