-
-
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?
Changes from all commits
65aa939
c8f02fc
d4b886e
fcbe062
e91bd05
7cb5a18
149fa34
70a7cd3
61ce79b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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 dsusp VDSUSP VFLUSHO VSTATUS noncanonical VMIN deciseconds noncanonical VTIME | ||
|
|
||
| use crate::Flag; | ||
|
|
||
|
|
@@ -65,10 +66,14 @@ 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), | ||
| // Not supported by nix and libc. | ||
| // Flag::new("hup", C::HUP).hidden(), | ||
| Flag::new("cstopb", C::CSTOPB), | ||
| Flag::new("cread", C::CREAD).sane(), | ||
| Flag::new("clocal", C::CLOCAL), | ||
| Flag::new("crtscts", C::CRTSCTS), | ||
| // Not supported by nix and libc. | ||
| // Flag::new("cdtrdsr", C::CDTRDSR), | ||
| ]; | ||
|
|
||
| pub const INPUT_FLAGS: &[Flag<I>] = &[ | ||
|
|
@@ -81,10 +86,18 @@ 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("ixoff", I::IXOFF), | ||
| Flag::new("tandem", I::IXOFF).hidden(), | ||
| // not supported by nix and libc: | ||
| // - https://github.com/rust-lang/libc/pull/4846 | ||
| // - https://github.com/nix-rust/nix/pull/2702 | ||
| // #[cfg(any( | ||
| // target_os = "aix", | ||
| // target_os = "android", | ||
| // target_os = "haiku", | ||
| // target_os = "linux", | ||
| // ))] | ||
| // Flag::new("iuclc", I::IUCLC), | ||
| Flag::new("ixany", I::IXANY), | ||
| Flag::new("imaxbel", I::IMAXBEL).sane(), | ||
|
|
@@ -112,6 +125,17 @@ pub const OUTPUT_FLAGS: &[Flag<O>] = &[ | |
| target_os = "linux", | ||
| target_os = "macos" | ||
| ))] | ||
| #[cfg(any( | ||
| target_os = "android", | ||
| target_os = "haiku", | ||
| target_os = "ios", | ||
| target_os = "linux", | ||
| target_os = "macos" | ||
| ))] | ||
| // Not supported by nix. | ||
| // See: https://github.com/nix-rust/nix/pull/2701 | ||
| // FIXME: Flag::new("ofill", O::OFILL), | ||
| Flag::new("ofill", O::from_bits_retain(nix::libc::OFILL)), | ||
| Flag::new("ofdel", O::OFDEL), | ||
| #[cfg(any( | ||
| target_os = "android", | ||
|
|
@@ -253,7 +277,15 @@ 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 | ||
| // Not supported by nix and libc: | ||
| // - https://github.com/rust-lang/libc/pull/4847 | ||
| // - https://github.com/nix-rust/nix/pull/2703 | ||
| // #[cfg(any( | ||
| // target_os = "aix", | ||
| // target_os = "android", | ||
| // target_os = "haiku", | ||
| // target_os = "linux", | ||
| // ))] | ||
| // Flag::new("xcase", L::XCASE), | ||
| Flag::new("tostop", L::TOSTOP), | ||
| Flag::new("echoprt", L::ECHOPRT), | ||
|
|
@@ -357,6 +389,18 @@ pub const CONTROL_CHARS: &[(&str, S)] = &[ | |
| ("stop", S::VSTOP), | ||
| // Sends a suspend signal (SIGTSTP). | ||
| ("susp", S::VSUSP), | ||
| #[cfg(any( | ||
| target_os = "freebsd", | ||
| target_os = "dragonfly", | ||
| target_os = "ios", | ||
| target_os = "macos", | ||
| target_os = "netbsd", | ||
| target_os = "openbsd", | ||
| target_os = "aix", | ||
| target_os = "solaris" | ||
| ))] | ||
| // Sends a delayed suspend signal (SIGTSTP). | ||
| ("dsusp", S::VDSUSP), | ||
| // Reprints the current line. | ||
| ("rprnt", S::VREPRINT), | ||
| // Deletes the last word typed. | ||
|
|
@@ -365,6 +409,25 @@ pub const CONTROL_CHARS: &[(&str, S)] = &[ | |
| ("lnext", S::VLNEXT), | ||
| // Discards the current line. | ||
| ("discard", S::VDISCARD), | ||
| // deprecated compat option. | ||
| // Not supported by nix and libc. | ||
| // ("flush", S::VFLUSHO), | ||
| #[cfg(any( | ||
| target_os = "freebsd", | ||
| target_os = "dragonfly", | ||
| target_os = "ios", | ||
| target_os = "macos", | ||
| target_os = "netbsd", | ||
| target_os = "openbsd", | ||
| ))] | ||
| // Status character | ||
| ("status", S::VSTATUS), | ||
| // Minimum number of characters for noncanonical read. | ||
| // We handle this manually. | ||
| // ("min", S::VMIN), | ||
|
Contributor
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. Is it possible that the nix compatibility is more about the platform that it is being built on?
Author
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. 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
Author
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. for this specific case, actually it was defined, but I commented this out since we use the value differently in the code |
||
| // 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 | ||
|
|
@@ -385,4 +448,5 @@ pub const COMBINATION_SETTINGS: &[(&str, bool)] = &[ | |
| ("pass8", true), | ||
| ("raw", true), | ||
| ("sane", false), | ||
| ("tabs", true), | ||
| ]; | ||
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