Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: some way to inherit kill ring in su'd shell?
- X-seq: zsh-users 13701
- From: Greg Klanderman <gak@xxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: some way to inherit kill ring in su'd shell?
- Date: Sun, 11 Jan 2009 20:58:28 -0500
- In-reply-to: <m3r63975pd.fsf@xxxxxxxxxxxxxx> (Greg Klanderman's message of "Sun, 11 Jan 2009 19:01:34 -0500")
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <18789.30656.261463.382208@xxxxxxxxxxxxxxxxxx> <20090110095231.GA61601@xxxxxxxxxxxxxxxxxxxx> <m33afq97gg.fsf@xxxxxxxxxxxxxx> <20090111025418.GA7272@xxxxxxxxxxxxxxxxxxxx> <m3tz857mkm.fsf@xxxxxxxxxxxxxx> <090111110748.ZM12349@xxxxxxxxxxxxxxxxxxxxxx> <m3r63975pd.fsf@xxxxxxxxxxxxxx>
- Reply-to: gak@xxxxxxxxxxxxxx
Hi Bart,
With the patch below, preserving just the CUTBUFFER is this simple:
function zle-line-init () {
if [[ ${ZLEKILLRINGPID-} != $$ && -n ${ZLECUTBUFFER-} ]] ; then
CUTBUFFER="$ZLECUTBUFFER"
fi
}
zle -N zle-line-init
function zle-line-finished () {
export ZLEKILLRINGPID=$$ ZLECUTBUFFER="$CUTBUFFER"
}
zle -N zle-line-finished
Is an enhancement something like this acceptable?
thanks,
Greg
Index: Doc/Zsh/zle.yo
===================================================================
RCS file: /cvsroot/zsh/zsh/Doc/Zsh/zle.yo,v
retrieving revision 1.75
diff -u -r1.75 zle.yo
--- Doc/Zsh/zle.yo 9 Dec 2008 17:37:01 -0000 1.75
+++ Doc/Zsh/zle.yo 12 Jan 2009 01:54:18 -0000
@@ -870,6 +870,11 @@
(The command inside the function sets the keymap directly; it is
equivalent to tt(zle vi-cmd-mode).)
)
+tindex(zle-line-finished)
+item(tt(zle-line-finished))(
+This is similar to tt(zle-line-init) but is executed every time the line
+editor is finished reading a new line of input.
+)
tindex(zle-keymap-select)
item(tt(zle-keymap-select))(
Executed every time the keymap changes, i.e. the special parameter
Index: Src/Zle/zle_main.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_main.c,v
retrieving revision 1.121
diff -u -r1.121 zle_main.c
--- Src/Zle/zle_main.c 9 Dec 2008 17:37:01 -0000 1.121
+++ Src/Zle/zle_main.c 12 Jan 2009 01:54:18 -0000
@@ -1212,6 +1212,15 @@
zlecore();
+ if ((initthingy = rthingy_nocreate("zle-line-finished"))) {
+ char *args[2];
+ args[0] = initthingy->nam;
+ args[1] = NULL;
+ execzlefunc(initthingy, args, 1);
+ unrefthingy(initthingy);
+ errflag = retflag = 0;
+ }
+
statusline = NULL;
invalidatelist();
trashzle();
Messages sorted by:
Reverse Date,
Date,
Thread,
Author