From 04a89199d02a3ee6c4b3d89a6c782bdb0a4f1bc8 Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Thu, 15 Apr 1999 18:20:19 +0000 Subject: zsh-3.1.5-pws-12 --- Src/Zle/zle_main.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'Src/Zle/zle_main.c') diff --git a/Src/Zle/zle_main.c b/Src/Zle/zle_main.c index 97d012f7b..7ac4a7126 100644 --- a/Src/Zle/zle_main.c +++ b/Src/Zle/zle_main.c @@ -394,11 +394,13 @@ getkey(int keytmout) return ret; } +static int no_restore_tty; + /* Read a line. It is returned metafied. */ /**/ unsigned char * -zleread(char *lp, char *rp, int ha) +zleread(char *lp, char *rp, int flags) { unsigned char *s; int old_errno = errno; @@ -451,7 +453,7 @@ zleread(char *lp, char *rp, int ha) pmpt_attr = txtchange; rpromptbuf = promptexpand(rp, 1, NULL, NULL); rpmpt_attr = txtchange; - histallowed = ha; + histallowed = (flags & ZLRF_HISTORY); PERMALLOC { histline = curhist; #ifdef HAVE_SELECT @@ -486,6 +488,8 @@ zleread(char *lp, char *rp, int ha) if (tmout) alarm(tmout); zleactive = 1; + if (flags & ZLRF_NOSETTY) + no_restore_tty = 1; resetneeded = 1; errflag = retflag = 0; lastcol = -1; @@ -535,7 +539,7 @@ zleread(char *lp, char *rp, int ha) trashzle(); free(lpromptbuf); free(rpromptbuf); - zleactive = 0; + zleactive = no_restore_tty = 0; alarm(0); } LASTALLOC; zsfree(curhistline); @@ -754,7 +758,7 @@ bin_vared(char *name, char **args, char *ops, int func) PERMALLOC { pushnode(bufstack, ztrdup(s)); } LASTALLOC; - t = (char *) zleread(p1, p2, ops['h']); + t = (char *) zleread(p1, p2, ops['h'] ? ZLRF_HISTORY : 0); if (!t || errflag) { /* error in editing */ errflag = 0; @@ -885,7 +889,8 @@ trashzle(void) fprintf(shout, "%s", postedit); fflush(shout); resetneeded = 1; - settyinfo(&shttyinfo); + if (!no_restore_tty) + settyinfo(&shttyinfo); } if (errflag) kungetct = 0; -- cgit 1.4.1