zsh-workers
 help / color / mirror / code / Atom feed
From: suzuki@otsl.oki.co.jp (SUZUKI Hisao)
To: zsh-workers@math.gatech.edu
Subject: zsh-3.0.3: a problem in Src/jobs.c
Date: Wed, 18 Jun 97 16:10:54 JST	[thread overview]
Message-ID: <9706180710.AA10798@oz.fantasy.otsl.oki.co.jp> (raw)

Jo napot kivanok!

	I found a problem in zsh-3.0.3/Src/jobs.c: when you
invoke, say, "emacs with x-window" in background, and quit the
emacs, then the tty setting is modified unexpectedly.  This is
inconvenient; at least, the behavior is not the same as those of
ksh, csh nor older zsh.  The following is the sample session:

	ares% stty
	speed 9600 baud; line = 0;
	intr = ^G; erase = ^H;
	-brkint ixoff -imaxbel
	-iexten -echoctl
	ares% emacs &
	[1] 6524
	ares% 
	[1]  + done       emacs
	ares% stty
	speed 9600 baud; line = 0;
	intr = ^G; quit = <undef>; erase = ^H; susp = <undef>; lnext = <undef>;
	flush = <undef>;
	-brkint inlcr ixoff -imaxbel
	-iexten -echoctl

where "ares" is an i586 box with Linux-2.0.27/Slackware-3.1.0.

	I made a quick hack to fix it for the time being.  The
following is it.  I am hoping the problem will be fixed soon.
----------------------------------------------------------------
*** zsh-3.0.3/Src/jobs.c.ORIG	Tue Jun  3 05:11:27 1997
--- zsh-3.0.3/Src/jobs.c	Wed Jun 18 05:17:02 1997
***************
*** 154,170 ****
  	}
      }
  
!     if (shout && !ttyfrozen && !jn->stty_in_env)
! 	gettyinfo(&shttyinfo);
  
!     if (isset(MONITOR)) {
! 	pid_t pgrp = gettygrp();           /* get process group of tty      */
! 
! 	/* is this job in the foreground of an interactive shell? */
! 	if (mypgrp != pgrp && inforeground &&
! 	    (jn->gleader == pgrp || (pgrp > 1 && kill(-pgrp, 0) == -1))) {
! 	    attachtty(mypgrp);
! 	    adjustwinsize();   /* check window size and adjust if necessary */
  	}
      }
  
--- 154,181 ----
  	}
      }
  
!     {
! 	pid_t pgrp = -1;
! 	int is_foreground = 0;	/* is this job in the foreground actually? */
  
! 	if (shout && !ttyfrozen && !jn->stty_in_env) {
! 	    pgrp = gettygrp();	/* get process group of tty */
! 	    is_foreground = (jn->gleader == pgrp ||
! 			     (pgrp > 1 && kill(-pgrp, 0) == -1));
! 	    if (is_foreground)
! 		gettyinfo(&shttyinfo);
! 	}
! 	if (isset(MONITOR)) {
! 	    if (pgrp == -1) {
! 		pgrp = gettygrp();
! 		is_foreground = (jn->gleader == pgrp ||
! 				 (pgrp > 1 && kill(-pgrp, 0) == -1));
! 	    }
! 	    /* is this job in the foreground of an interactive shell? */
! 	    if (mypgrp != pgrp && inforeground && is_foreground) {
! 		attachtty(mypgrp);
! 		adjustwinsize(); /* check window size & adjust if necessary */
! 	    }
  	}
      }
  
----------------------------------------------------------------

Regards,

Hisao Suzuki <suzuki@otsl.oki.co.jp>


                 reply	other threads:[~1997-06-18  7:21 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=9706180710.AA10798@oz.fantasy.otsl.oki.co.jp \
    --to=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).