Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: counterintuitive behavior of zle_bracketed_paste
- X-seq: zsh-workers 41268
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Peter Backes <rtc@xxxxxxxxxxxxxxxxxxx>, zsh-workers@xxxxxxx
- Subject: Re: counterintuitive behavior of zle_bracketed_paste
- Date: Sun, 11 Jun 2017 10:55:19 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=sQ2QPXpq15z62UBTPdQEI5uUm14PzpPBBFB8GrMVK/c=; b=BTa/jvb7rLyqFDB7bU+foEDVbeiXQzAA9eX0KpqNODRaNTQwICFRojcZe5KhAokyqp FnF9LfD+kaAM6QEhZeKT1vMF8b4p23TtgLZfDFsmZjzGU0S7GZKEm7DsGWvUnS/kPRjn GDmxOWIvraDE9WquMuUafW/sOrbkuf11c4TsffUoD7nHGO0LONAc7wKdnrGji6AVp1A0 RTkyZ48b3K8VZVCEX7mSm0s8X5LYWD8KND4gA313tnRahqCn2BSmq2ZGts5wMS3Q0t84 /bGyCUWCCxTwaTccGyKUMgh8FFPGd5jh6Ht4zF1zUrrI2XN8VmZzvQ8lKx5BX2dGCZv9 V3Bw==
- In-reply-to: <20170611103726.GA15108@helen.PLASMA.Xg8.DE>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20170611103726.GA15108@helen.PLASMA.Xg8.DE>
On Jun 11, 12:37pm, Peter Backes wrote:
}
} While backeted paste mode is certainly a good thing, this behavior is
} very counterintuitive. If the last pasted character is a return, the
} command should instead be executed instantly.
Thanks for your input, but we had quite a long discussion about this on
the mailing list and the consensus was for the current behavior.
IIRC the case that brought us to this conclusion was what happens when
the paste is in the middle of the edit buffer rather than at a fresh
prompt or at the end of the buffer; i.e., when $RBUFFER is not empty.
The contents of the existing buffer as well as the presence of newlines
in the pasted text, matters, and it is better to have one consistent
paste behavior that does the least surprising thing in all cases.
As Daniel has already mentioned, there are ways to customize around
this if you strongly feel that a different behavior is better for you.
In addition to his suggested function, the bracketed-paste-magic widget
provides several hooks for modifying bracketed-paste behavior.
E.g.:
autoload bracketed-paste-magic
zle -N bracketed-paste bracketed-paste-magic
bp-run-immediate () {
[[ "$PASTED" = *$'\n' ]] && zle -U $'\n'
}
zstyle :bracketed-paste-magic paste-finish bp-run-immediate
Messages sorted by:
Reverse Date,
Date,
Thread,
Author