--- Begin Message ---
Subject: |
stty sane behaviour. |
Date: |
Tue, 28 Jun 2016 16:03:09 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 |
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.
--- End Message ---
--- Begin Message ---
Subject: |
Re: bug#23866: stty sane behaviour. |
Date: |
Wed, 29 Jun 2016 10:02:55 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
On 29/06/16 02:06, Rich Burridge wrote:
> On 06/28/2016 05:05 PM, Pádraig Brady wrote:
>> On 29/06/16 00:03, Rich Burridge wrote:
>>> ...
>> 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
>
> Assuming you mean:
>
> --- src/stty.c.orig 2016-06-28 17:48:25.580754994 -0700
> +++ src/stty.c 2016-06-28 17:51:21.725276863 -0700
> @@ -120,7 +120,7 @@
>
> /* 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__
> +#if defined __sun
> # undef CSWTCH
> # define CSWTCH _POSIX_VDISABLE
> #endif
>
> and I'm sure you do, this works great.
Cool, pushed at:
http://git.sv.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=v8.25-41-gdfae782
thanks,
Pádraig.
--- End Message ---