Repository navigation
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
Open
3v1n0
wants to merge
7
commits into
uutils:main
Choose a base branch
from
3v1n0:stty-better-printing
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+302
−33
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
4edffac
stty: Move solarish and dsusp to the cspell wordlist
3v1n0 f679049
stty: Gate termios flags not defined on all platforms
3v1n0 ca333be
stty/flags: Do not show tandem option
3v1n0 c77f85a
stty/flags: Use same order of GNU in printing ixoff/ixon
3v1n0 8c19779
stty/flags: List all missing flags that GNU version supports
3v1n0 288460c
stty/flags: Add delayed suspend (dsusp) support
3v1n0 056caab
stty: Use nix line_discipline on linux/android/haiku
3v1n0 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,9 +7,10 @@ | |
| // spell-checker:ignore ignbrk brkint ignpar parmrk inpck istrip inlcr igncr icrnl ixoff ixon iuclc ixany imaxbel iutf | ||
| // spell-checker:ignore opost olcuc ocrnl onlcr onocr onlret ofdel nldly crdly tabdly bsdly vtdly ffdly | ||
| // spell-checker:ignore isig icanon iexten echoe crterase echok echonl noflsh xcase tostop echoprt prterase echoctl ctlecho echoke crtkill flusho extproc | ||
| // spell-checker:ignore lnext rprnt susp swtch vdiscard veof veol verase vintr vkill vlnext vquit vreprint vstart vstop vsusp vswtc vwerase werase | ||
| // spell-checker:ignore lnext rprnt susp dsusp swtch vdiscard veof veol verase vintr vkill vlnext vquit vreprint vstart vstop vsusp vswtc vwerase werase VDSUSP | ||
| // spell-checker:ignore sigquit sigtstp | ||
| // spell-checker:ignore cbreak decctlq evenp litout oddp | ||
| // spell-checker:ignore cdtrdsr CDTRDSR ofill OFILL VFLUSHO VSTATUS noncanonical VMIN deciseconds noncanonical VTIME | ||
|
|
||
| use crate::Flag; | ||
|
|
||
|
|
@@ -54,11 +55,15 @@ pub const CONTROL_FLAGS: &[Flag<C>] = &[ | |
| Flag::new_grouped("cs7", C::CS7, C::CSIZE), | ||
| Flag::new_grouped("cs8", C::CS8, C::CSIZE).sane(), | ||
| Flag::new("hupcl", C::HUPCL), | ||
| // GNU's `hup`, hidden as GNU never displays it (OMIT). | ||
| Flag::new("hup", C::HUPCL).hidden(), | ||
| Flag::new("cstopb", C::CSTOPB), | ||
| Flag::new("cread", C::CREAD).sane(), | ||
| Flag::new("clocal", C::CLOCAL), | ||
| #[cfg(not(target_os = "redox"))] | ||
| #[cfg(not(any(target_os = "redox", target_os = "aix")))] | ||
| Flag::new("crtscts", C::CRTSCTS), | ||
| // Not supported by nix and libc. | ||
| // Flag::new("cdtrdsr", C::CDTRDSR), | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| ]; | ||
|
|
||
| pub const INPUT_FLAGS: &[Flag<I>] = &[ | ||
|
|
@@ -71,14 +76,22 @@ pub const INPUT_FLAGS: &[Flag<I>] = &[ | |
| Flag::new("inlcr", I::INLCR), | ||
| Flag::new("igncr", I::IGNCR), | ||
| Flag::new("icrnl", I::ICRNL).sane(), | ||
| Flag::new("ixoff", I::IXOFF), | ||
| Flag::new("tandem", I::IXOFF), | ||
| Flag::new("ixon", I::IXON), | ||
| // not supported by nix | ||
| // Flag::new("iuclc", I::IUCLC), | ||
| #[cfg(not(target_os = "redox"))] | ||
| Flag::new("ixoff", I::IXOFF), | ||
| Flag::new("tandem", I::IXOFF).hidden(), | ||
| #[cfg(any( | ||
| target_os = "aix", | ||
| target_os = "android", | ||
| target_os = "cygwin", | ||
| target_os = "haiku", | ||
| target_os = "hurd", | ||
| target_os = "linux", | ||
| target_os = "nto", | ||
| solarish | ||
| ))] | ||
| Flag::new("iuclc", I::IUCLC), | ||
|
3v1n0 marked this conversation as resolved.
|
||
| Flag::new("ixany", I::IXANY), | ||
| #[cfg(not(target_os = "redox"))] | ||
| #[cfg(not(any(target_os = "redox", target_os = "haiku")))] | ||
| Flag::new("imaxbel", I::IMAXBEL).sane(), | ||
| #[cfg(any(target_vendor = "apple", target_os = "android", target_os = "linux"))] | ||
| Flag::new("iutf8", I::IUTF8), | ||
|
|
@@ -97,6 +110,20 @@ pub const OUTPUT_FLAGS: &[Flag<O>] = &[ | |
| Flag::new("onlcr", O::ONLCR).sane(), | ||
| Flag::new("onocr", O::ONOCR), | ||
| Flag::new("onlret", O::ONLRET), | ||
| #[cfg(any( | ||
| target_vendor = "apple", | ||
| target_os = "aix", | ||
| target_os = "android", | ||
| target_os = "cygwin", | ||
| target_os = "fuchsia", | ||
| target_os = "haiku", | ||
| target_os = "hurd", | ||
| target_os = "linux", | ||
| target_os = "nto", | ||
| target_os = "redox", | ||
| solarish | ||
| ))] | ||
| Flag::new("ofill", O::OFILL), | ||
| #[cfg(any( | ||
| target_vendor = "apple", | ||
| target_os = "android", | ||
|
|
@@ -228,8 +255,14 @@ pub const LOCAL_FLAGS: &[Flag<L>] = &[ | |
| Flag::new("echok", L::ECHOK).sane(), | ||
| Flag::new("echonl", L::ECHONL), | ||
| Flag::new("noflsh", L::NOFLSH), | ||
| // Not supported by nix | ||
| // Flag::new("xcase", L::XCASE), | ||
| #[cfg(any( | ||
| target_os = "aix", | ||
| target_os = "android", | ||
| target_os = "haiku", | ||
| target_os = "nto", | ||
| target_os = "linux", | ||
| ))] | ||
| Flag::new("xcase", L::XCASE), | ||
| Flag::new("tostop", L::TOSTOP), | ||
| #[cfg(not(any(target_os = "cygwin", target_os = "redox")))] | ||
| Flag::new("echoprt", L::ECHOPRT), | ||
|
|
@@ -245,7 +278,12 @@ pub const LOCAL_FLAGS: &[Flag<L>] = &[ | |
| Flag::new("crtkill", L::ECHOKE).sane().hidden(), | ||
| #[cfg(not(target_os = "redox"))] | ||
| Flag::new("flusho", L::FLUSHO), | ||
| #[cfg(not(any(target_os = "cygwin", target_os = "redox")))] | ||
| #[cfg(not(any( | ||
| target_os = "cygwin", | ||
| target_os = "redox", | ||
| target_os = "aix", | ||
| target_os = "haiku" | ||
| )))] | ||
| Flag::new("extproc", L::EXTPROC), | ||
| ]; | ||
|
|
||
|
|
@@ -276,7 +314,9 @@ pub const BAUD_RATES: &[(&str, BaudRate)] = &[ | |
| target_os = "cygwin", | ||
| target_os = "fuchsia", | ||
| target_os = "hurd", | ||
| target_os = "redox" | ||
| target_os = "redox", | ||
| target_os = "aix", | ||
| target_os = "haiku" | ||
| )))] | ||
| ("460800", BaudRate::B460800), | ||
| #[cfg(any(target_os = "android", target_os = "linux"))] | ||
|
|
@@ -288,7 +328,9 @@ pub const BAUD_RATES: &[(&str, BaudRate)] = &[ | |
| target_os = "cygwin", | ||
| target_os = "fuchsia", | ||
| target_os = "hurd", | ||
| target_os = "redox" | ||
| target_os = "redox", | ||
| target_os = "aix", | ||
| target_os = "haiku" | ||
| )))] | ||
| ("921600", BaudRate::B921600), | ||
| #[cfg(any(target_os = "android", target_os = "linux"))] | ||
|
|
@@ -348,14 +390,33 @@ pub const CONTROL_CHARS: &[(&str, S)] = &[ | |
| ("stop", S::VSTOP), | ||
| // Sends a suspend signal (SIGTSTP). | ||
| ("susp", S::VSUSP), | ||
| #[cfg(any(bsd, solarish, target_os = "aix"))] | ||
| // Sends a delayed suspend signal (SIGTSTP). | ||
| ("dsusp", S::VDSUSP), | ||
|
3v1n0 marked this conversation as resolved.
3v1n0 marked this conversation as resolved.
Comment on lines
+393
to
+395
|
||
| #[cfg(not(target_os = "haiku"))] | ||
| // Reprints the current line. | ||
| ("rprnt", S::VREPRINT), | ||
| #[cfg(not(any(target_os = "aix", target_os = "haiku")))] | ||
| // Deletes the last word typed. | ||
| ("werase", S::VWERASE), | ||
| #[cfg(not(target_os = "haiku"))] | ||
| // Enters literal mode (next character is taken literally). | ||
| ("lnext", S::VLNEXT), | ||
| #[cfg(not(any(target_os = "aix", target_os = "haiku")))] | ||
| // Discards the current line. | ||
| ("discard", S::VDISCARD), | ||
| // deprecated compat option. | ||
| // Not supported by nix and libc. | ||
| // ("flush", S::VFLUSHO), | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not defined in POSIX, which platforms support it? |
||
| #[cfg(any(bsd, target_os = "illumos"))] | ||
| // Status character | ||
| ("status", S::VSTATUS), | ||
| // Minimum number of characters for noncanonical read. | ||
| // We handle this manually. | ||
| // ("min", S::VMIN), | ||
| // Timeout in deciseconds for noncanonical read. | ||
| // We handle this manually. | ||
| // ("time", S::VTIME), | ||
| ]; | ||
|
|
||
| /// This constant lists all possible combination settings, using a bool to represent if the setting is negatable | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.