From 1ee6295909c893c55693232a12f10cd8625a7260 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Tue, 18 Dec 2007 10:42:36 +0000 Subject: 24279: allow terminal changes after zle -I to be acquired by main shell --- Src/Zle/zle_main.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'Src/Zle/zle_main.c') diff --git a/Src/Zle/zle_main.c b/Src/Zle/zle_main.c index 2817f9249..e29b759e9 100644 --- a/Src/Zle/zle_main.c +++ b/Src/Zle/zle_main.c @@ -208,10 +208,21 @@ mod_export void zsetterm(void) { struct ttyinfo ti; - #if defined(FIONREAD) int val; +#endif + if (fetchttyinfo) { + /* + * User requested terminal to be returned to normal use, + * so remember the terminal settings if not frozen. + */ + if (!ttyfrozen) + gettyinfo(&shttyinfo); + fetchttyinfo = 0; + } + +#if defined(FIONREAD) ioctl(SHTTY, FIONREAD, (char *)&val); if (val) { /* @@ -1113,6 +1124,7 @@ zleread(char **lp, char **rp, int flags, int context) insmode = unset(OVERSTRIKE); eofsent = 0; resetneeded = 0; + fetchttyinfo = 0; raw_lp = lp; lpromptbuf = promptexpand(lp ? *lp : NULL, 1, NULL, NULL); pmpt_attr = txtchange; -- cgit 1.4.1