-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Improve the stty --all output to match GNU version
#9432
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
GNU testsuite comparison: |
b287c72 to
9c6d77f
Compare
|
GNU testsuite comparison: |
46cbbc3 to
b989937
Compare
|
GNU testsuite comparison: |
b989937 to
bae055d
Compare
|
GNU testsuite comparison: |
| // Status character | ||
| // ("status", S::VSTATUS), // Not supported by nix | ||
| // Minimum number of characters for noncanonical read. | ||
| // ("min", S::VMIN), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible that the nix compatibility is more about the platform that it is being built on?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked the code, but there are no such definitions... I wanted to submit a change there too, but I'm unsure about what platforms are supported, so I'd rather wait for someone having it to support it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for this specific case, actually it was defined, but I commented this out since we use the value differently in the code
src/uu/stty/src/flags.rs
Outdated
| target_os = "macos" | ||
| ))] | ||
| // Not supported by nix. | ||
| // Flag::new("ofill", O::OFILL), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a typo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added to nix-rust/nix#2701 also
Related to: uutils/coreutils#9432
bae055d to
173ad5a
Compare
| Flag::new("ixoff", I::IXOFF), | ||
| Flag::new("tandem", I::IXOFF).hidden(), | ||
| // not supported by nix | ||
| // Flag::new("iuclc", I::IUCLC), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not related to this PR, but this is being added to libc rust-lang/libc#4846 then we need to update nix
|
GNU testsuite comparison: |
173ad5a to
65b5c7a
Compare
Related to: uutils/coreutils#9432
Related to: uutils/coreutils#9432
704772b to
fa39e80
Compare
|
GNU testsuite comparison: |
f0de189 to
61ce79b
Compare
|
GNU testsuite comparison: |
|
For making this easier to review for the maintainers, do you think it would be possible to split the Flag updates and the column env variable and printer? Recently the ability for the integration tests in test_stty are able to run on the CI and if it would be possible could you create a test for the column output showing it working? |
Yeah, I was considering it in fact now that there is such support indeed... I was wondering also if doing GNU core-utils comparisons would make sense, but it cannot be done in a static way since the values may change, but a proper test would be runnig |
Yeah, they are already in different commits. In fact I was expecting the PR to be reviewed considering each commit as atomic, but I can split it out if you prefer to have different PRs instead (I know github per-commit review workflow is far away from the good that it is in gitlab) |
|
#9338 I have some more details in here about some of the GNU current incompatibilities, there is a test in the GNU test suite that tests the COLUMN env variable and maybe replicating that would be the best way to do it |
|
This is an output agnostic way to test it thats used in the GNU test suite, that we're looking to have compatibility with |
|
Hi, I come from nix-rust/nix, let me know if you need nix to drop a release when those PRs get merged |
We can probably wait until the libc missing stuff has landed too |
|
Mind if I cherry-pick that first commit of yours to a new pr and add another commit for adding the integ tests for that commit? I'm just particularly focused on that env COLUMNS portion of the PR since after the saved state parser its the only thing missing to make a few of the STTY GNU tests pass. |
Sure, feel free |
* termios: Add OFILL Related to: uutils/coreutils#9432 * changelog * typo: Android --------- Co-authored-by: Steve Lau <[email protected]>
Yeah, nix PRs depend on those libc PRs |
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
Now the order is respected
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
This is going to be supported via those PRs, so let's track them to make it easier to support it in future
Until nix won't include it we can safely just rely on the libc definition
Nix now supports the line discipline parameter in various platforms, so use upstream definition instead of going through libc See: nix-rust/nix#1802
61ce79b to
e6e285a
Compare
The output of
stty --allwas not really matching GNU one, adjust it to follow the same logicBefore:
After:
Highlight is not great for word diffing, but well:
After the flags we're missing will be included upstream, the diff will be actually none.