Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: precmd() affecting the "r" command output



On Jun 12,  7:05pm, Josselin Noirel wrote:
} Subject: precmd() affecting the "r" command output
}
} precmd() is supposed to be executed once before each prompt (according
} to the man page) but here it is executed one more time, when "r" is
} executed.

I'm surprised no one has ever noticed this before (it's been happening
this way for *years*), but I think this is what's needed:

Index: Src/init.c
===================================================================
RCS file: /extra/cvsroot/zsh/zsh-4.0/Src/init.c,v
retrieving revision 1.20
diff -c -r1.20 init.c
--- Src/init.c	14 Apr 2005 04:33:51 -0000	1.20
+++ Src/init.c	12 Jun 2005 19:34:24 -0000
@@ -112,7 +112,7 @@
 	hbegin(1);		/* init history mech        */
 	if (isset(SHINSTDIN)) {
 	    setblock_stdin();
-	    if (interact) {
+	    if (interact && toplevel) {
 	        int hstop = stophist;
 		stophist = 3;
 		preprompt();



Messages sorted by: Reverse Date, Date, Thread, Author