From 4508d25710de08793005923b1f91f5ae072f3945 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Fri, 17 Apr 2015 10:23:58 +0100 Subject: 34905: no parse error after keyboard interrupt. Handled generally, though only showing up in special nested cases. Also fix ZLE so it doesn't cancel the interrupt flag when not actually returning from a local keymap. --- ChangeLog | 5 +++++ Src/Zle/zle_keymap.c | 3 ++- Src/lex.c | 10 ++++++---- Src/parse.c | 2 +- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index ec8423c02..3b3804a99 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-04-17 Peter Stephenson + + * 34905: Src/Zle/zle_keymap.c, Src/lex.c, Src/parse.c: suppress + parse errors resulting from keyboard interruption. + 2015-04-16 Mikael Magnusson * 34902: Doc/Zsh/compsys.yo, Doc/Zsh/contrib.yo, Doc/Zsh/zle.yo: diff --git a/Src/Zle/zle_keymap.c b/Src/Zle/zle_keymap.c index cfef88217..c6fae251d 100644 --- a/Src/Zle/zle_keymap.c +++ b/Src/Zle/zle_keymap.c @@ -503,8 +503,9 @@ selectkeymap(char *name, int fb) mod_export void selectlocalmap(Keymap m) { + Keymap oldm = localkeymap; localkeymap = m; - if (!m) + if (oldm && !m) { /* * No local keymap; so we are returning to the global map. If diff --git a/Src/lex.c b/Src/lex.c index 184a54b0b..c929bb9ba 100644 --- a/Src/lex.c +++ b/Src/lex.c @@ -1558,10 +1558,12 @@ parsestr(char **s) if ((err = parsestrnoerr(s))) { untokenize(*s); - if (err > 32 && err < 127) - zerr("parse error near `%c'", err); - else - zerr("parse error"); + if (!(errflag & ERRFLAG_INT)) { + if (err > 32 && err < 127) + zerr("parse error near `%c'", err); + else + zerr("parse error"); + } } return err; } diff --git a/Src/parse.c b/Src/parse.c index 0b54a904d..91a81e1ff 100644 --- a/Src/parse.c +++ b/Src/parse.c @@ -2419,7 +2419,7 @@ yyerror(int noerr) for (t0 = 0; t0 != 20; t0++) if (!t || !t[t0] || t[t0] == '\n') break; - if (!(histdone & HISTFLAG_NOEXEC)) { + if (!(histdone & HISTFLAG_NOEXEC) && !(errflag & ERRFLAG_INT)) { if (t0 == 20) zwarn("parse error near `%l...'", t, 20); else if (t0) -- cgit 1.4.1