Subject: Re: /bin/sh, /bin/csh and the '^C'
To: None <atatat@atatdot.net>
From: Andrew Gillham <gillhaa@ghost.whirlpool.com>
List: current-users
Date: 04/05/1999 23:29:41
Andrew Brown writes:
> 
> i've always attributed it to the fact that tcsh (and bash, fwiw) both
> set the terminal into "raw" mode (with echo off as well?), while sh
> and csh, afaik, either only set it to cbreak mode, or just tell it to
> ignore signals.  in apps that i've written, i usually have the sigint
> handler print "\b \b\b \b\r\n" to erase the ^C garbage.

On NetBSD/i386 1.3.3, if I have /bin/sh as my shell, it works as I would
expect.  It interrupts, without printing '^C' first.  If I type '/bin/sh'
the new shell has the problem.  Comparing the output of 'stty -a' from
the two shells:
<       -echoprt -altwerase -noflsh -tostop -flusho -pendin -nokerninfo
---
>       -echoprt -altwerase -noflsh -tostop -flusho pendin -nokerninfo

The working shell has 'pendin', the broken '-pendin', which seems odd
to me.  Looking at 'pendin' in the stty manpage, it really doesn't seem
relevant.

-Andrew
-- 
-----------------------------------------------------------------
Andrew Gillham                            | This space left blank
gillham@whirlpool.com                     | inadvertently.
I speak for myself, not for my employer.  | Contact the publisher.