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

Re: PATCH: unwanted error aborting continued command substitution



On Fri, 17 Apr 2015 08:46:45 -0700
Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> push-input uses send-break,
> and send-break is supposed to be a simulated interrupt for cases where
> the TTY intr character is not set.
> 
> So either send-break should actually set ERRFLAG_INT, or we need a third
> error flag for simulated interrupts.

Actually, it doesn't bother calling send-break, but I've found the point
where it doesn't.

Maybe the following is OK --- in fact, possibly we don't need the
ERRFLAG_ERROR bit set, but I don't think it's doing any harm.

One advantage of using a different bit would be we could abort back to
the top of ZLE rather than out of ZLE and back in again, which would
mean you finally had the ability to embed push-line in other widgets.
But that's for another day.

pws

diff --git a/Src/Zle/zle_hist.c b/Src/Zle/zle_hist.c
index 88623bb..cc66f99 100644
--- a/Src/Zle/zle_hist.c
+++ b/Src/Zle/zle_hist.c
@@ -854,7 +854,7 @@ pushlineoredit(char **args)
     }
     ret = pushline(args);
     if (!isfirstln) {
-	errflag |= ERRFLAG_ERROR;
+	errflag |= ERRFLAG_ERROR|ERRFLAG_INT;
 	done = 1;
     }
     clearlist = 1;
diff --git a/Src/Zle/zle_misc.c b/Src/Zle/zle_misc.c
index 23286fc..4669ef2 100644
--- a/Src/Zle/zle_misc.c
+++ b/Src/Zle/zle_misc.c
@@ -1041,7 +1041,7 @@ copyprevshellword(UNUSED(char **args))
 int
 sendbreak(UNUSED(char **args))
 {
-    errflag |= ERRFLAG_ERROR;
+    errflag |= ERRFLAG_ERROR|ERRFLAG_INT;
     return 1;
 }
 



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