about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@zsh.org>2015-09-03 17:52:40 +0100
committerPeter Stephenson <pws@zsh.org>2015-09-03 17:52:40 +0100
commit32f5d3d8c16b4f3a11fa39c0ee378d72336ba853 (patch)
treed3cca4c81753d5fd43b18326e3490705be3875e4
parent1ba2fac03d611ca2955e1c019c9cc9189fd2920b (diff)
downloadzsh-32f5d3d8c16b4f3a11fa39c0ee378d72336ba853.tar.gz
zsh-32f5d3d8c16b4f3a11fa39c0ee378d72336ba853.tar.xz
zsh-32f5d3d8c16b4f3a11fa39c0ee378d72336ba853.zip
36416: ^C in getzlequery() just aborts query.
Also logical but possibly invisible fix for error propagated
back from listing interface.
-rw-r--r--ChangeLog8
-rw-r--r--Src/Zle/zle_refresh.c3
-rw-r--r--Src/Zle/zle_utils.c5
3 files changed, 15 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index bf10cbdac..f9822b9c8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2015-09-03  Peter Stephenson  <p.stephenson@samsung.com>
+
+	* 36416: Src/Zle/zle_refresh.c, Src/Zle/zle_utils.c: If
+	keyboard interrupt during getzlequery(), don't propagate further,
+	just redraw the line.  Also handle logical error that we
+	attempted to redware the line partially if an error or interrupt
+	was propagated.
+
 2015-09-03  Daniel Shahaf  <d.s@daniel.shahaf.name>
 
 	* 36403: Src/hashtable.c Test/A02alias.ztst: type -w +=
diff --git a/Src/Zle/zle_refresh.c b/Src/Zle/zle_refresh.c
index 78046fb7b..0c28c0a2d 100644
--- a/Src/Zle/zle_refresh.c
+++ b/Src/Zle/zle_refresh.c
@@ -1761,7 +1761,8 @@ singlelineout:
 	inlist = 1;
 	listmatches();
 	inlist = 0;
-	zrefresh();
+	if (!errflag)
+	    zrefresh();
     }
     if (showinglist == -1)
 	showinglist = nlnct;
diff --git a/Src/Zle/zle_utils.c b/Src/Zle/zle_utils.c
index d1d320613..9751f7a1f 100644
--- a/Src/Zle/zle_utils.c
+++ b/Src/Zle/zle_utils.c
@@ -1183,6 +1183,11 @@ getzlequery(void)
 
     /* get a character from the tty and interpret it */
     c = getfullchar(0);
+    /*
+     * We'll interpret an interruption here as only interrupting the
+     * query, not the line editor.
+     */
+    errflag &= ~ERRFLAG_INT;
     if (c == ZWC('\t'))
 	c = ZWC('y');
     else if (ZC_icntrl(c) || c == ZLEEOF)