Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Shift-Insert overwrites ZLE CUTBUFFER
- X-seq: zsh-users 22030
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: Shift-Insert overwrites ZLE CUTBUFFER
- Date: Wed, 26 Oct 2016 09:01:33 -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=BejyujLikcFqaVqs6XHxTL4NgahRvng+9OKFzCP6a1A=; b=ma0D0ty8optqjOIcoW1zG1CguSFgRkySJEq+C69Zg+JmR7I8CPqt06/z8p/cHswLlq ev/xcoj9eqVGHIt+Kt5p9bISXOIhGR9uC3qOr5zJiE4lvaP3M2P+oIJPXF5/PgxxVaD5 Tor3tljqWBpFmD1NEV4naNl4Fee83fhXcwi0qCAZ4n30CgMwL0g5JUl7UCJUu2HN8MLL 9JnzTZHvOKuweaCT99g2YtyTdMAEqbs4nBW24LHi7AgANVUPsE0iAmWYrXKLORik1PPp o2oT5watdzZC6iBOGCLMk83EVxZy6/55RDOMjh0iINtgIAMB5g9UvAWBD8RlO2XpBdOB IrAA==
- In-reply-to: <CAMtVo_N6qOQr++Amzn11+m3pkOxjc908mwFUerur77+OWd92uw@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CAMtVo_PG_fd62V1FZ4r7fRUragzzS6H4McN5sO1=hhY=6DR6Yg@mail.gmail.com> <161025091249.ZM7232@torch.brasslantern.com> <CAMtVo_N6qOQr++Amzn11+m3pkOxjc908mwFUerur77+OWd92uw@mail.gmail.com>
On Oct 26, 12:28am, lolilolicon wrote:
} Subject: Re: Shift-Insert overwrites ZLE CUTBUFFER
}
} On Wed, Oct 26, 2016 at 12:12 AM, Bart Schaefer
} <schaefer@xxxxxxxxxxxxxxxx> wrote:
} > There's currently no easy way to change the cutbuffer behavior without
} > disabling the rest of the bracketed-paste behavior.
}
} That's a shame.
} Is it technically difficult to do? Would there be an issue if zsh just
} popped the killring automatically?
What I mean is that it's not easy to do from shell code. In the source
code obviously the implementation is deliberately pushing the kill ring,
so it wouldn't be technically difficult to *not* do so, but that would
mean reversing an earlier design decision.
Something like this sort of works:
my-bracketed-paste {
zle .bracketed-paste "$@" && {
local pasted=$CUTBUFFER
# Swap the top two killed items to fake out ^Y
CUTBUFFER=$killring[1]
killring[1]=$pasted
}
}
zle -N bracketed-paste my-bracketed-paste
But I wouldn't have called that an "easy way".
Various other approaches involving saving/restoring CUTBUFFER and killring
are also possible.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author