From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22757 invoked by alias); 8 Sep 2015 23:40:14 -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: X-Seq: 36454 Received: (qmail 28932 invoked from network); 8 Sep 2015 23:40:12 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FSL_HELO_NON_FQDN_1 autolearn=ham autolearn_force=no version=3.4.0 Date: Wed, 9 Sep 2015 01:33:06 +0200 From: Carsten Hey To: zsh-workers@zsh.org Subject: Re: bracketed paste - chopping trailing newlines Message-ID: <20150908233306.GJ30848@bosko.stateful.de> References: <20150829012452.GE30848@bosko.stateful.de> <150828220057.ZM14497@torch.brasslantern.com> <20150830202530.GF30848@bosko.stateful.de> <150901164827.ZM2480@torch.brasslantern.com> <20150903235936.GH30848@bosko.stateful.de> <20150906095224.GD1895@tarsus.local2> <4397.1441547465@thecus.kiddle.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4397.1441547465@thecus.kiddle.eu> User-Agent: Mutt/1.5.21 (2010-09-15) * Oliver Kiddle [2015-09-06 15:51 +0200]: > Daniel Shahaf wrote: > > The behaviour is: (a) pastes are never executed until is > > pressed; (b) zle_highlight is set; ... It is still an open question, or at least one without a clear consensus, whether using paste:standout or paste:underline would be a more reasonable choice if highlighting will be enabled by default. I consider paste:standout to be a more natural choice, but there were concerns regarding using it as default. I have no clear preference for any of these two options. > > ... (c) newlines are removed only at . > > I really don't see the point of doing (c). For example, if this is not done, and assuming the default configuration using the emacs keymap, you'd have to press three times to move two entries back in history list after pasting and accepting a command with a trailing newline. > With a trailing newline, it is now hard to discern that the line hasn't > been executed: the cursor advances to the next line whether the newline > is accepted or inserted so without the stripping the user is left > waiting until they lose patience. This is a very intuitive way if users paste exactly one newline and know that they did so. Additional highlighting could further improve this intuitiveness, but it is not necessary for this example. If you paste a command with two trailing newlines into zsh 5.1 running in an xterm, the result looks like this (an underline is used as cursor): % cp -a /data /mnt/foo _ If you paste a command with one trailing newline into zsh 5.1 running in a screen (the latest release, not the 5.x development branch), the result looks like this: % cp -a /data /mnt/foo _ As you notice, both are indistinguishable, but only the first one shows a running command, and the second one shows a paste waiting to be accepted. > I think that the default behaviour > should cater to normal users who don't follow this list. > I agree that the newline stripping isn't ideal but it seemed the best > option for the short term. I fully agree, and I consider 5.1 to be adequate for such a short term solution. 5.1-test-1-1 is already tagged in git, and the long term solution is still being discussed, thus it could not have been part of a non-delayed 5.1. For the next release, or at least the one following the next one, a long term solution could be targeted. > And it is possible to work around it with a custom widget. I think we all agree that we are only discussing the default behaviour. Regards Carsten