Skip to content

Conversation

@3v1n0
Copy link

@3v1n0 3v1n0 commented Nov 21, 2025

The output of stty --all was not really matching GNU one, adjust it to follow the same logic

Before:

--- /tmp/gnu-stty	2025-11-21 01:41:14.909020716 +0100
+++ /tmp/rust-stty	2025-11-21 00:38:42.324215733 +0100
@@ -1,10 +1,6 @@
-speed 38400 baud; rows 57; columns 112; line = 0;
-intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
-eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
-werase = ^W; lnext = ^V; discard = ^O; min = 1; time = 0;
--parenb -parodd -cmspar cs8 -hupcl -cstopb cread -clocal -crtscts
--ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff
--iuclc -ixany -imaxbel iutf8
-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 -flusho -extproc
+speed 38400 baud; rows 57; columns 115; line = 0;
+intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; discard = ^O; min = 1; time = 0;
+-parenb -parodd -cmspar cs8 -hupcl -cstopb cread -clocal -crtscts 
+-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl -ixoff -tandem ixon -ixany -imaxbel iutf8 
+opost -olcuc -ocrnl onlcr -onocr -onlret -ofdel nl0 cr0 tab0 bs0 vt0 ff0 
+isig icanon iexten echo echoe echok -echonl -noflsh -tostop -echoprt echoctl echoke -flusho -extpro```

After:

--- /tmp/gnu-stty	2025-11-21 01:41:14.909020716 +0100
+++ /tmp/rust-stty	2025-11-21 04:31:16.511313289 +0100
@@ -4,7 +4,7 @@
 werase = ^W; lnext = ^V; discard = ^O; min = 1; time = 0;
 -parenb -parodd -cmspar cs8 -hupcl -cstopb cread -clocal -crtscts
 -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff
--iuclc -ixany -imaxbel iutf8
-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 -flusho -extproc
+-ixany -imaxbel iutf8
+opost -olcuc -ocrnl onlcr -onocr -onlret -ofdel nl0 cr0 tab0 bs0 vt0 ff0
+isig icanon iexten echo echoe echok -echonl -noflsh -tostop -echoprt echoctl
+echoke -flusho -extproc

Highlight is not great for word diffing, but well:

❯ wdiff /tmp/stty-out /tmp/rstty-out 
speed 38400 baud; rows 57; columns 112; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werase = ^W; lnext = ^V; discard = ^O; min = 1; time = 0;
-parenb -parodd -cmspar cs8 -hupcl -cstopb cread -clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff
[--iuclc-]
-ixany -imaxbel iutf8
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 -flusho -extpro

@github-actions
Copy link

GNU testsuite comparison:

GNU test failed: tests/cksum/cksum-base64-untagged. tests/cksum/cksum-base64-untagged is passing on 'main'. Maybe you have to rebase?
Skipping an intermittent issue tests/tail/overlay-headers (passes in this run but fails in the 'main' branch)

@3v1n0 3v1n0 force-pushed the stty-better-printing branch 2 times, most recently from b287c72 to 9c6d77f Compare November 21, 2025 06:33
@github-actions
Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/tail/overlay-headers (passes in this run but fails in the 'main' branch)

@3v1n0 3v1n0 force-pushed the stty-better-printing branch from 9c6d77f to 46cbbc3 Compare November 21, 2025 06:54
Do the same as GNU stty when it has to prints the parameter, doing
proper text wrapping
It is just an alias for ixoff, and it's marked with `OMIT` in GNU
version
@3v1n0 3v1n0 force-pushed the stty-better-printing branch from 46cbbc3 to b989937 Compare November 21, 2025 06:57
@github-actions
Copy link

GNU testsuite comparison:

Congrats! The gnu test tests/cksum/cksum-base64-untagged is no longer failing!

It's only supported by BSD, aix and solaris, but still available in nix
List the remaining flags that GNU stty support, they cannot be be listed
yet since we have no nix support for them, but it's better to keep the
lists in sync so that it's easier to enable what will be supported in
future
@3v1n0 3v1n0 force-pushed the stty-better-printing branch from b989937 to bae055d Compare November 21, 2025 07:32
@github-actions
Copy link

GNU testsuite comparison:

Congrats! The gnu test tests/cksum/cksum-base64-untagged is no longer failing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant