about summary refs log tree commit diff
path: root/Src/Zle/zle_thingy.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2007-12-18 10:42:36 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2007-12-18 10:42:36 +0000
commit1ee6295909c893c55693232a12f10cd8625a7260 (patch)
tree362a318d0d61d8922d6076bcc440f762a94e4d54 /Src/Zle/zle_thingy.c
parentac33044bd2a99a0dd70784e98d89992737f44e98 (diff)
downloadzsh-1ee6295909c893c55693232a12f10cd8625a7260.tar.gz
zsh-1ee6295909c893c55693232a12f10cd8625a7260.tar.xz
zsh-1ee6295909c893c55693232a12f10cd8625a7260.zip
24279: allow terminal changes after zle -I to be acquired by main shell
Diffstat (limited to 'Src/Zle/zle_thingy.c')
-rw-r--r--Src/Zle/zle_thingy.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/Src/Zle/zle_thingy.c b/Src/Zle/zle_thingy.c
index 536ddcd6a..fb0dbb092 100644
--- a/Src/Zle/zle_thingy.c
+++ b/Src/Zle/zle_thingy.c
@@ -711,6 +711,17 @@ bin_zle_call(char *name, char **args, UNUSED(Options ops), UNUSED(char func))
     return ret;
 }
 
+
+/*
+ * Flag that the user has requested the terminal be trashed
+ * for whatever use.  We attempt to keep the tty settings in
+ * this mode synced with the normal (non-zle) settings unless
+ * they are frozen.
+ */
+
+/**/
+int fetchttyinfo;
+
 /**/
 static int
 bin_zle_invalidate(UNUSED(char *name), UNUSED(char **args), UNUSED(Options ops), UNUSED(char func))
@@ -721,7 +732,18 @@ bin_zle_invalidate(UNUSED(char *name), UNUSED(char **args), UNUSED(Options ops),
      * true if a completion widget is active.
      */
     if (zleactive) {
+	int wastrashed = trashedzle;
 	trashzle();
+	if (!wastrashed && (zlereadflags & ZLRF_NOSETTY)) {
+	    /*
+	     * We normally wouldn't have restored the terminal
+	     * in this case, but as it's at user request we do
+	     * so (hence the apparently illogical sense of the
+	     * second part of the test).
+	     */
+	    settyinfo(&shttyinfo);
+	}
+	fetchttyinfo = 1;
 	return 0;
     } else
 	return 1;