zsh-workers
 help / color / mirror / code / Atom feed
* zsh stty control for background processes
@ 1997-01-31  5:54 Yoshiaki Kasahara
  1997-01-31  8:57 ` Bart Schaefer
  0 siblings, 1 reply; 3+ messages in thread
From: Yoshiaki Kasahara @ 1997-01-31  5:54 UTC (permalink / raw)
  To: zsh-workers

Hello.

I'm not a member of zsh-workers, so please Cc: replies to me.

When I invoked 'xterm &', new shell in the xterm forget some of stty
control characters.

This is 'stty all' output of the original shell(zsh-3.1.0 on BSD/OS
2.1).

% stty all
speed 9600 baud; 24 rows; 80 columns;
lflags: icanon isig iexten echo echoe echok echoke -echonl echoctl
        -echoprt -altwerase -noflsh -tostop -flusho pendin -nokerninfo
        -extproc
iflags: -istrip icrnl -inlcr -igncr ixon -ixoff -ixany imaxbel -ignbrk
        brkint -inpck -ignpar -parmrk
oflags: opost onlcr oxtabs
cflags: cread cs8 -parenb -parodd hupcl -clocal -noclocal -cstopb
        -cts_oflow -rts_iflow -mdmbuf
discard dsusp   eof     eol     eol2    erase   intr    kill    lnext   
^O      ^Y      ^D      <undef> <undef> ^H      ^C      ^U      ^V      
min     quit    reprint start   status  stop    susp    time    werase  
1       ^\      ^R      ^Q      <undef> ^S      ^Z      0       ^W      

And this is 'stty all' output of new shell in xterm (invoked in
background).

% stty all
speed 9600 baud; 24 rows; 80 columns;
lflags: icanon isig iexten echo echoe -echok echoke -echonl echoctl
        -echoprt -altwerase -noflsh -tostop -flusho pendin -nokerninfo
        -extproc
iflags: -istrip icrnl -inlcr -igncr ixon -ixoff -ixany imaxbel -ignbrk
        brkint -inpck -ignpar -parmrk
oflags: opost onlcr -oxtabs
cflags: cread cs8 -parenb -parodd hupcl -clocal -noclocal -cstopb
        -cts_oflow -rts_iflow -mdmbuf
discard dsusp   eof     eol     eol2    erase   intr    kill    lnext   
^@      ^@      ^D      <undef> <undef> ^H      ^C      ^U      ^@      
min     quit    reprint start   status  stop    susp    time    werase  
1       ^@      ^R      ^@      <undef> ^@      ^@      0       ^W      

The similar problem occured on Solaris 2.5 and SunOS 4.1.4, too.

It still occurs even if I use no startup file, but forgotten entries
vary like this:

% stty all
speed 9600 baud; 24 rows; 80 columns;
lflags: icanon isig iexten echo echoe -echok echoke -echonl echoctl
        -echoprt -altwerase -noflsh -tostop -flusho pendin -nokerninfo
        -extproc
iflags: -istrip icrnl -inlcr -igncr ixon -ixoff -ixany imaxbel -ignbrk
        brkint -inpck -ignpar -parmrk
oflags: opost onlcr -oxtabs
cflags: cread cs8 -parenb -parodd hupcl -clocal -noclocal -cstopb
        -cts_oflow -rts_iflow -mdmbuf
discard dsusp   eof     eol     eol2    erase   intr    kill    lnext   
^@      ^@      ^D      <undef> <undef> ^H      ^C      ^U      ^@      
min     quit    reprint start   status  stop    susp    time    werase  
1       ^@      ^R      ^Q      <undef> ^S      ^@      0       ^W      

This problem never occurs on tcsh, csh, or sh.  It is ok if xterm is
invoked on foreground.  I tried zsh-3.0-pre, zsh-3.0.0, zsh-3.0.2, and
zsh-3.1.0.  Also I checked /usr/contrib/bin/zsh (v2.5.03 distributed
with BSD/OS 2.1) and found that this problem occured....

Is it a bug of zsh, or something wrong with me?  Sorry if it had
already reported/corrected.

Regards,
-- 
Yoshiaki Kasahara
KITE Network Operation Center, Computer Center, Kyushu University

Email addr:                           |  I'm free!   & ~ __-^-_/~
    kasahara@nc.kyushu-u.ac.jp        |               ~   \___/


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: zsh stty control for background processes
  1997-01-31  5:54 zsh stty control for background processes Yoshiaki Kasahara
@ 1997-01-31  8:57 ` Bart Schaefer
  1997-01-31  9:20   ` Yoshiaki Kasahara
  0 siblings, 1 reply; 3+ messages in thread
From: Bart Schaefer @ 1997-01-31  8:57 UTC (permalink / raw)
  To: Yoshiaki Kasahara, zsh-workers

On Jan 31,  2:54pm, Yoshiaki Kasahara wrote:
} Subject: zsh stty control for background processes
}
} When I invoked 'xterm &', new shell in the xterm forget some of stty
} control characters.

This isn't exactly a shell bug; it's partly an xterm bug.  It results
when xterm copies stty information from the system console, which may
not have been set up correctly before X11 (OpenWindows) started up on it
when you first logged in.  (Or it may be that you're on a remote display,
and the xterm is getting whatever settings some other process applied to
the system console.)

} It is ok if xterm is invoked on foreground.

It's OK then because the foreground xterm can still open a controlling
tty (that of the parent shell) from which to copy the settings.

} This problem never occurs on tcsh, csh, or sh.

I've seen it happen with shells other than zsh, usually when running some
non-shell program with `xterm -e ...'.  There may be something about the
way zsh spawns background jobs that makes it more likely.

There are several possible workarounds:

If you have a modern version of xterm, there is a resource XTerm*ttyModes
that you can use to specify stty settings for all xterms that start up.
That resource was created for this problem; it is the best solution.

In your shell initialization files, force the console to have sane stty
values before you start openwin.  This may not work if openwin itself
is what's messing up the console settings, or if you're logging in via
a remote display.

Start all xterms as login shells (XTerm*loginShell: true, I believe),
so .zlogin gets read (I presume you have stty commands there for your
initial login terminal settings).  This may be undesirable, and won't
help for `xterm -e ...' where the xterm is not running a zsh.

Put a test `[[ -t 0 ]] && stty ...' in your .zshenv, to force the settings
be sane for any zsh that starts with a terminal as standard input.  This
won't work for `xterm -e ...' either.

-- 
Bart Schaefer                             Brass Lantern Enterprises
http://www.well.com/user/barts            http://www.nbn.com/people/lantern


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: zsh stty control for background processes
  1997-01-31  8:57 ` Bart Schaefer
@ 1997-01-31  9:20   ` Yoshiaki Kasahara
  0 siblings, 0 replies; 3+ messages in thread
From: Yoshiaki Kasahara @ 1997-01-31  9:20 UTC (permalink / raw)
  To: schaefer; +Cc: zsh-workers

On Fri, 31 Jan 1997 00:57:48 -0800,
	"Bart Schaefer" <schaefer@candle.brasslantern.com> said:

> If you have a modern version of xterm, there is a resource XTerm*ttyModes
> that you can use to specify stty settings for all xterms that start up.
> That resource was created for this problem; it is the best solution.

This works fine for both xterm & kterm (xterm variant for display
japanese kanji).

Thank you very much.
-- 
Yoshiaki Kasahara
KITE Network Operation Center, Computer Center, Kyushu University

Email addr:                           |  I'm free!   & ~ __-^-_/~
    kasahara@nc.kyushu-u.ac.jp        |               ~   \___/


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1997-01-31  9:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-01-31  5:54 zsh stty control for background processes Yoshiaki Kasahara
1997-01-31  8:57 ` Bart Schaefer
1997-01-31  9:20   ` Yoshiaki Kasahara

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).