zsh-workers
 help / color / mirror / code / Atom feed
From: Per Bothner <per@bothner.com>
To: zsh-workers@zsh.org
Subject: zle - poor terminal echo on input line shortening
Date: Sun, 7 Apr 2019 16:46:18 -0700	[thread overview]
Message-ID: <e29cd884-30c0-76e8-1b18-f7f362b24085@bothner.com> (raw)

[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@bothner.com   http://per.bothner.com/

             reply	other threads:[~2019-04-07 23:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-07 23:46 Per Bothner [this message]
2019-04-08 15:09 ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e29cd884-30c0-76e8-1b18-f7f362b24085@bothner.com \
    --to=per@bothner.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).