From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id a0db6d69 for ; Sun, 7 Apr 2019 23:47:23 +0000 (UTC) Received: (qmail 28511 invoked by alias); 7 Apr 2019 23:47:10 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 44209 Received: (qmail 20875 invoked by uid 1010); 7 Apr 2019 23:47:10 -0000 X-Qmail-Scanner-Diagnostics: from aibo.runbox.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.101.1/25412. spamassassin: 3.4.2. Clear:RC:0(91.220.196.211):SA:0(-2.6/5.0):. Processed in 1.855078 secs); 07 Apr 2019 23:47:10 -0000 X-Envelope-From: per@bothner.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at bothner.com designates 91.220.196.211 as permitted sender) From: Per Bothner Subject: zle - poor terminal echo on input line shortening To: zsh-workers@zsh.org Message-ID: Date: Sun, 7 Apr 2019 16:46:18 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit [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/