From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 646 invoked by alias); 7 Sep 2015 02:22:57 -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: 36438 Received: (qmail 15519 invoked from network); 7 Sep 2015 02:22:56 -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=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU autolearn=ham autolearn_force=no version=3.4.0 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=tXS2v4Ks4aBhjG+/ FeCqem7qDTE=; b=ZYMwwJ4iKdNqYKTyOeTusw9iLfN2vPjMUQI1BSwKAt7BBRqB pLNCGQQzmifVKGvDSpApUllD9GqMfZy7gd1RJeJNgE5fpw2j10xNEt77mSE+rEjt +m7e+lw5kfZypn4rz6iS+voFbh9wfd5YT4euuFGJ+rT9Fmmmnhj0MTu8n9Q= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=tXS2v4Ks4aBhjG+ /FeCqem7qDTE=; b=ohP6g5ZYWcXfsG4wu6XHqJWt9owVLZPm5c6OyZ1ODV+b30l thMmi/B6L/2BEmYvZRPurYLsh6lI6QpzwhexSAqvbIX7cYh7vXLAyG0kKHkl+LOR mKvwj3u1tI5sqfv1l8xL/KzdbqvafxAIakBGNBEez9v1C6gjpT1n6GQBVtVQ= X-Sasl-enc: ghtxkMoSRPd4k+urnMg4dY/b/A74mT1ao26ALda3/E6G 1441591907 Date: Mon, 7 Sep 2015 02:11:45 +0000 From: Daniel Shahaf To: Oliver Kiddle Cc: zsh-workers@zsh.org Subject: Re: bracketed paste - chopping trailing newlines Message-ID: <20150907021145.GC6263@tarsus.local2> 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=utf-8 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 wrote on Sun, Sep 06, 2015 at 15:51:05 +0200: > Daniel Shahaf wrote: > > The behaviour is: (a) pastes are never executed until is pressed; > > (b) zle_highlight is set; (c) newlines are removed only at . > > I really don't see the point of doing (c). Several reasons: 1. So that making several pastes in a row, which each paste a single line including a \n, will retain the newlines. In 5.1, the newlines will be eaten (and users might not know how to insert literal newlines "by hand" at a place where would simply execute the input-so-far). 2. Cosmetic: when I have a screenful of prompts, I'd like all of them to have the same number of empty lines between them, regardless of whether the command was typed manually or pasted. In other words, once I've decided to execute the command, I'm happy to remove any trailing \n's it may have. 3. Avoid saving trailing newlines into history. > Perhaps the reason for > removing newlines in the current 5.1 behaviour has got lost in all this. > From pre-5.1, users are accustomed to pasted newlines being executed. > 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. Thanks for reminding us of that. I do agree that we shouldn't confuse users. However, I also think that most useful handling of pastes is to never strip newlines. I do not think we should be handling pastes in a suboptimal manner in order to avoid risking confusing users. I think we should handle pastes optimally — which, to me, means the behaviour described in my previous mail — and find some other way to ensure we don't confuse users. How about trying to collect some actual data about whether or not newline retention confuses users? For example, we could make the 5.1-test-2 release behave as I'm suggesting, and then wait to see whether users who test that release complain about pasted commands hanging indefinitely. > I think that the default behaviour > should cater to normal users who don't follow this list. Agreed. > I agree that the newline stripping isn't ideal but it seemed the best > option for the short term. And it is possible to work around it with a > custom widget. I'm thinking of 'zsh -f' and of the long term. I think the behaviour I'm proposing would make perfect sense to someone who has never pasted into a shell in his life. Cheers, Daniel