zsh-workers
 help / color / mirror / code / Atom feed
From: Zoltan Hidvegi <hzoli@ny.frontiercomm.net>
To: suzuki@otsl.oki.co.jp (SUZUKI Hisao)
Cc: zsh-workers@math.gatech.edu (Zsh hacking and development)
Subject: Re: zsh-3.0.3: another problem in Src/jobs.c
Date: Mon, 23 Jun 1997 22:52:42 -0400 (EDT)	[thread overview]
Message-ID: <199706240252.WAA04438@hzoli.home> (raw)
In-Reply-To: <9706240205.AA02610@oz.fantasy.otsl.oki.co.jp> from SUZUKI Hisao at "Jun 24, 97 11:05:37 am"

> >> 	% emacs -nw &
> >> 	% fg
> >> 	[type ^X^C to terminate the emacs]
> >> 	% stty
> >> 
> >> 	[Note: this is not artificial.  When you forget to set
> >> 	 DISPLAY, you will be put in the same situation.]

OK, here is an other patch.  When a process started in the background in
the first place, zsh will ignore the tty settings it leaves after it
exits, even if it is brought to the foreground afterwards.

This should fix the emacs problem, and even the suspend/fg workaround
will be unnecessary.

Zoltan


*** Src/zsh.h	1997/06/05 04:44:57	3.1.3.0
--- Src/zsh.h	1997/05/04 05:18:36
***************
*** 592,597 ****
--- 592,599 ----
  #define STAT_SUPERJOB	(1<<7)	/* job has a subjob                     */
  #define STAT_SUBJOB	(1<<8)	/* job is a subjob                      */
  #define STAT_CURSH	(1<<9)	/* last command is in current shell     */
+ #define STAT_NOSTTY	(1<<10)	/* the tty settings are not inherited   */
+ 				/* from this job when it exits.         */
  
  #define SP_RUNNING -1		/* fake status for jobs currently running */
  
*** Src/exec.c	1997/06/05 04:44:57	3.1.3.0
--- Src/exec.c	1997/06/24 02:42:47
***************
*** 654,659 ****
--- 654,660 ----
      pline_level--;
      if (how & Z_ASYNC) {
  	lastwj = newjob;
+ 	jobtab[thisjob].stat |= STAT_NOSTTY;
  	if (l->flags & PFLAG_COPROC)
  	    zclose(ipipe[1]);
  	if (how & Z_DISOWN) {
*** Src/jobs.c	1997/06/22 23:08:08	3.1.3.4
--- Src/jobs.c	1997/06/24 02:44:11
***************
*** 157,163 ****
      }
  
      if (shout && !ttyfrozen && !jn->stty_in_env &&
! 	job == thisjob && !somestopped)
  	gettyinfo(&shttyinfo);
  
      if (isset(MONITOR)) {
--- 157,163 ----
      }
  
      if (shout && !ttyfrozen && !jn->stty_in_env &&
! 	job == thisjob && !somestopped && !(jn->stat & STAT_NOSTTY))
  	gettyinfo(&shttyinfo);
  
      if (isset(MONITOR)) {


  reply	other threads:[~1997-06-24  2:55 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-06-23 10:51 SUZUKI Hisao
1997-06-23 15:22 ` Zoltan Hidvegi
1997-06-24  2:05   ` SUZUKI Hisao
1997-06-24  2:52     ` Zoltan Hidvegi [this message]
1997-06-24 11:56       ` SUZUKI Hisao
     [not found] <3.0.1.32.19970624091754.01331150@home.incontext.com>
1997-06-25  1:10 ` SUZUKI Hisao
1997-06-25  3:10   ` Bart Schaefer
  -- strict thread matches above, loose matches on Subject: below --
1997-06-19  6:24 SUZUKI Hisao
1997-06-19  7:04 ` Zoltan Hidvegi
1997-06-19  7:26   ` Andrei Tcherepanov
1997-06-19 23:32   ` SUZUKI Hisao
1997-06-20  3:45     ` Zoltan Hidvegi
1997-06-20  8:20       ` SUZUKI Hisao
1997-06-19  8:58 ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199706240252.WAA04438@hzoli.home \
    --to=hzoli@ny.frontiercomm.net \
    --cc=suzuki@otsl.oki.co.jp \
    --cc=zsh-workers@math.gatech.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).