From hohmuth@irs201.inf.tu-dresden.de  Wed May 15 16:46:23 1996
Received: from irs201.inf.tu-dresden.de (irs201.inf.tu-dresden.de [141.76.16.201])
          by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id QAA04200
          for <FreeBSD-gnats-submit@freebsd.org>; Wed, 15 May 1996 16:46:18 -0700 (PDT)
Received: (from hohmuth@localhost) by irs201.inf.tu-dresden.de (8.6.12/8.6.9) id BAA07453; Thu, 16 May 1996 01:45:24 +0200
Message-Id: <199605152345.BAA07453@irs201.inf.tu-dresden.de>
Date: Thu, 16 May 1996 01:45:24 +0200
From: hohmuth@inf.tu-dresden.de
To: FreeBSD-gnats-submit@freebsd.org
Subject: /bin/sh + emacs + ^G = ruined terminal
X-Send-Pr-Version: 3.2

>Number:         1206
>Category:       bin
>Synopsis:       /bin/sh + emacs + ^G = ruined terminal
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    cracauer
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed May 15 16:50:01 PDT 1996
>Closed-Date:    Thu Aug 27 18:25:45 MEST 1998
>Last-Modified:  Thu Aug 27 18:26:51 MEST 1998
>Originator:     Michael Hohmuth
>Release:        FreeBSD 2.1.0-RELEASE i386
>Organization:
Dept. of Computer Science, TU Dresden, Germany
>Environment:

olymp:~> uname -a 
FreeBSD olymp.inf.tu-dresden.de 2.1.0-RELEASE FreeBSD 2.1.0-RELEASE #0: Thu May  2 13:18:23 MET DST 1996     root@olymp.inf.tu-dresden.de:/usr/src/sys/compile/OLYMP  i386

olymp:~> printenv
TERM=vt100
HOME=/home/hohmuth
SHELL=/usr/local/bin/tcsh
LOGNAME=hohmuth
USER=hohmuth
PATH=/home/hohmuth/local/setup/site/other/host/olymp/bin:/home/hohmuth/local/setup/bin:/home/hohmuth/local/bin:/usr/local/bin:/usr/X11R6/bin:/usr/bin:/bin:/usr/games:.
HOSTTYPE=FreeBSD
VENDOR=intel
OSTYPE=FreeBSD
MACHTYPE=i386
SHLVL=1
PWD=/home/hohmuth
GROUP=staff
HOST=olymp.inf.tu-dresden.de

olymp:~> stty
speed 9600 baud;
lflags: echoe echoke echoctl tostop pendin
oflags: -oxtabs
cflags: cs8 -parenb

Using Emacs-19.29 from the packages collection.

>Description:

When starting emacs though a /bin/sh script, and then typing ^G,
thereby generating a QUIT signal to the terminal (I believe), this
signal is being interpreted by the shell (even though emacs should
have established its own terminal session).  The shell will exit and
leave emacs running in the background.

Emacs will still access the terminal (writing "Garbage
collecting...done" messages to it), but can't any longer be controlled
through it.

>How-To-Repeat:

    > tcsh				# don't try this from within 
					# /bin/sh, this will leave
					# your terminal in an unusable
					# state
					
    tcsh% mv .emacs foo			# move .emacs out of the way
    tcsh% /bin/sh -c emacs		# start up emacs through /bin/sh

Now, within emacs, type ^G (this normally invokes the emacs function
"keyboard-quit").

This will make the tcsh prompt appear again; this should not have
happened.  The terminal will now be in some funny state:  Emacs is
still running on it (not suspended) and will sometimes print its
"Garbage collecting...done" messages to it.  It is impossible to
re-attach to emacs by means of "fg".

The following commands don't produce the erratic behaviour:

-   /bin/sh
    emacs

-   emacs				# from any shell

-   /bin/csh -c emacs

>Fix:
	
	
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->joerg 
Responsible-Changed-By: joerg 
Responsible-Changed-When: Wed Jul 17 13:18:03 MET DST 1996 
Responsible-Changed-Why:  
I'm collecting the sh bug reports. 
Responsible-Changed-From-To: joerg->steve 
Responsible-Changed-By: steve 
Responsible-Changed-When: Tue Oct 15 19:10:31 PDT 1996 
Responsible-Changed-Why:  
I am working on this one. 
State-Changed-From-To: open->closed 
State-Changed-By: steve 
State-Changed-When: Mon Oct 21 20:02:40 PDT 1996 
State-Changed-Why:  
Fixed in version 1.6 of eval.c. 
State-Changed-From-To: closed->open 
State-Changed-By: peter 
State-Changed-When: Tue Nov 12 10:37:31 PST 1996 
State-Changed-Why:  
The changes to work around this problem were just backed out 
in rev 1.8 of bin/sh/eval.c, there were too many side effects. 
Responsible-Changed-From-To: steve->cracauer 
Responsible-Changed-By: steve 
Responsible-Changed-When: Tue Apr 28 05:57:57 PDT 1998 
Responsible-Changed-Why:  
Martin said he would take this one. 
State-Changed-From-To: open->closed 
State-Changed-By: cracauer 
State-Changed-When: Thu Aug 27 18:25:45 MEST 1998 
State-Changed-Why:  
Fixed in -current and -stable, several commits to bin/sh und various tools. 
>Unformatted:

