Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: counterintuitive behavior of zle_bracketed_paste
- X-seq: zsh-workers 41266
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: Peter Backes <rtc@xxxxxxxxxxxxxxxxxxx>
- Subject: Re: counterintuitive behavior of zle_bracketed_paste
- Date: Sun, 11 Jun 2017 15:39:00 +0000
- Cc: zsh-workers@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; 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-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=RfCFoT L7vo7k+iTqoBeheb57Btpp/XIhqYwdk9GEqUM=; b=tmlCuyt7yUTpec8oKWEOv+ OxwBqfdI80JtGmylJ2fUmoKKUi49YRHeP8gqKAD4PUroMtSH4wt/8+SPMe5G2dJG B7RnikTqpIBNRqUYFNSuEu521mDJAIIv9tOZes1IMj/l53edN8+4oDf65Uj43hJ1 ZFOulP3hTwY00sDBprILnWp5K6ftyPqs+MwAPciniaM6bdH5XkbHPbXsT7+i1t7g PuA+jANbeUD2In+V2t0usN8N8dEdJ7TlwarRn7xclHh4QNfqQGC0HwbODNOy7v1T DcNnWJoMcMJG1TFaF0UCcj2UR6DMBQ9oDBycmk5awV7FolXqjWWtzfz+J3Ac+ijQ ==
- Dkim-signature: v=1; a=rsa-sha256; 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-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=RfCFoT L7vo7k+iTqoBeheb57Btpp/XIhqYwdk9GEqUM=; b=fZ5cjEhMlHYySM6mT9qmVI TxOHQHM5eVg/cbP97Cqs9GFxTGkSupgYoLivzyKzzVt1gu0tMfPTvlMFuIw4J6/H 7ojdTbhDKuUFRGTKF1iF2/MIBUY8mizxFW/1ES6TWWx75BWCJWpZ1rF5iT4lLEvO DzSP7ceQ5Z1imWS0Hk6vOsSm7XEJiPwpUwqzKyDoidwI9Gsz05y02FAKHKvErQ/w jorIUvCjZf9IOI2Nq5D68lD1LOWEQlkqbvBH8wNUse+Z9pa0OXhmQJkOcfLWeT5c cykCiYAK4rjrYA0hm5qCADKINdmsMCTZD0JPSam4kmwwl/vh4LfQCzzjUppNgZ4Q ==
- 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>
Peter Backes wrote on Sun, 11 Jun 2017 12:37 +0200:
> 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. Users who do not want to
> execute instantly can simply not paste a return on the last line, as
> before. Please change zsh accordingly.
You can change the behaviour locally by overriding the bracketed-paste
widget in your zshrc:
[[[
bracketed-paste() {
local PASTED # as in bracketed-paste-magic
zle .bracketed-paste PASTED
# mimic built-in widget's functionality
(( NUMERIC == 0 )) || PASTED=${(q-)PASTED}
zle -f 'yank'; YANK_START=$#LBUFFER; (( YANK_END = $#LBUFFER + $#PASTED ))
LBUFFER+=$PASTED
if [[ $PASTED[-1] == $'\n' ]]; then
zle accept-line
fi
}
zle -N bracketed-paste
]]]
I'll let others comment on your second question of changing the defaults.
Cheers,
Daniel
> Please mail me directly if you reply as I am not subscribed to the list.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author