bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#23866: stty sane behaviour.


From: Pádraig Brady
Subject: bug#23866: stty sane behaviour.
Date: Wed, 29 Jun 2016 01:05:01 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

On 29/06/16 00:03, Rich Burridge wrote:
> This was filed as a Solaris bug against the GNU coreutils version of
> stty. I don't know enough to determine whether there is a real problem
> here on not, so forwarding to the experts.
> 
> /usr/bin/stty is the Solaris version of stty and /usr/gnu/bin/stty is
> the one in GNU coreutils.
> 
> Thanks.
> 
> ----
> 
> Description
>      I have not investigated this thoroughly, but it would appear that GNU
>      stty, feels that sanity involves no-oping job control, by setting the
>      (ancient, never really used) swtch to ^z, causing it to be ignored,
>      (susp is also ^z, but swtch wins).
> 
>      stty(1) describes sane thusly:
> 
>      sane                    Reset all modes to  some  reasonable
>                                  values.
> 
>      I argue that values which apparently clobber job control are not 
> reasonable.
>      The GNU stty(1) says:
> 
>       sane same as cread -ignbrk brkint -inlcr -igncr icrnl -iutf8
>            -ixoff  -iuclc -ixany imaxbel opost -olcuc -ocrnl onlcr
>            -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0  vt0  ff0
>            isig  icanon  iexten  echo  echoe echok -echonl -noflsh
>            -xcase -tostop -echoprt  echoctl  echoke,  all  special
>            characters to their default values
> 
>      "all special characters to their default values", if swtch and susp 
> really do
>      default to ^z, swtch should be changed.
> 
> Frequency
>      Always
> 
> Regression
>      no
> 
> 
> $ tcsh
>  > /usr/bin/stty -a
> speed 38400 baud;
> rows = 65; columns = 80; ypixels = 0; xpixels = 0;
> csdata ?
> eucw 1:0:0:0, scrw 1:0:0:0
> intr = ^c; quit = ^\; erase = ^?; kill = ^u;
> eof = ^d; eol = <undef>; eol2 = <undef>; swtch = <undef>;
> start = ^q; stop = ^s; susp = ^z; dsusp = ^y;
> rprnt = ^r; flush = ^o; werase = ^w; lnext = ^v;
> -parenb -parodd cs8 -cstopb -hupcl cread -clocal -loblk -crtscts 
> -crtsxoff -parext
> -ignbrk brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl -iuclc
> ixon -ixany -ixoff -imaxbel
> isig icanon -xcase echo echoe echok -echonl -noflsh
> -tostop echoctl -echoprt echoke -defecho -flusho -pendin iexten
> opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel tab3
> 
>  > /usr/bin/stty sane
> 
>  > /usr/bin/stty -a
> speed 38400 baud;
> rows = 65; columns = 80; ypixels = 0; xpixels = 0;
> csdata ?
> eucw 1:0:0:0, scrw 1:0:0:0
> intr = ^c; quit = ^\; erase = ^?; kill = ^u;
> eof = ^d; eol = <undef>; eol2 = <undef>; swtch = <undef>;
> start = ^q; stop = ^s; susp = ^z; dsusp = ^y;
> rprnt = ^r; flush = ^o; werase = ^w; lnext = ^v;
> -parenb -parodd cs8 -cstopb -hupcl cread -clocal -loblk -crtscts 
> -crtsxoff -parext
> -ignbrk brkint ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl -iuclc
> ixon -ixany -ixoff imaxbel
> isig icanon -xcase echo echoe echok -echonl -noflsh
> -tostop echoctl -echoprt echoke -defecho -flusho -pendin iexten
> opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel
> 
>  > /usr/gnu/bin/stty sane
> 
>  > /usr/bin/stty -a
> speed 38400 baud;
> rows = 65; columns = 80; ypixels = 0; xpixels = 0;
> csdata ?
> eucw 1:0:0:0, scrw 1:0:0:0
> intr = ^c; quit = ^\; erase = ^?; kill = ^u;
> eof = ^d; eol = <undef>; eol2 = <undef>; swtch = ^z;
> start = ^q; stop = ^s; susp = ^z; dsusp = ^y;
> rprnt = ^r; flush = ^o; werase = ^w; lnext = ^v;
> -parenb -parodd cs8 -cstopb -hupcl cread -clocal -loblk -crtscts 
> -crtsxoff -parext
> -ignbrk brkint ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl -iuclc
> ixon -ixany -ixoff imaxbel
> isig icanon -xcase echo echoe echok -echonl -noflsh
> -tostop echoctl -echoprt echoke -defecho -flusho -pendin iexten
> opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel
>  >
> 
> Expected Result
>      swtch = undef, working job control via 'susp', ^Z
> 
> Actual Result
>      ^z being both swtch and susp, ^Z not functioning for job control
> 
> 
> Workaround
>      explicitly specify /usr/bin/stty sane, when sanity is required.

Thanks for the detailed analysis.
It looks like this was already handled and we need to
expand the conditions where this is done.  The current code is:

  /* SunOS 5.3 loses (^Z doesn't work) if 'swtch' is the same as 'susp'.
     So the default is to disable 'swtch.'  */
  #if defined __sparc__ && defined __svr4__
  # undef CSWTCH
  # define CSWTCH _POSIX_VDISABLE
  #endif

How about we guard this with just:

  #ifdef __sun
  #endif

thanks,
Pádraig





reply via email to

[Prev in Thread] Current Thread [Next in Thread]