Repository navigation
Conversation
| } | ||
| } | ||
|
|
||
| termios.control_flags = ControlFlags::CS7 | other_flags; |
There was a problem hiding this comment.
is the parenb part needed? it isn't about grouped flags, i would drop it
| } | ||
| } | ||
|
|
||
| #[cfg(target_os = "linux")] |
There was a problem hiding this comment.
could you please also add the reported case here (cs8 then cs7)? the CSIZE group is only covered by the unit test
d967c12 to
29df738
Compare
|
Removed the unrelated parity assertions and added a real-binary regression test for CS8 → CS7. It catches the original bug, and all 85 active tests and Clippy pass. Squashed the update into one commit. |
| .no_output(); | ||
|
|
||
| // Linux PTYs reject CS7. Leaving CS8 set would incorrectly succeed. | ||
| new_ucmd!() |
There was a problem hiding this comment.
this relies on the kernel rejecting cs7 on a pty, isn't it fragile with other kernel versions?
There was a problem hiding this comment.
Good catch—removed the assumption that CS7 must fail. The test now compares stty’s result and resulting flags with a direct tcsetattr call on the same PTY, allowing for platform differences.
29df738 to
6bc2628
Compare
| #[cfg(target_os = "linux")] | ||
| #[test] | ||
| fn test_character_size_cs8_then_cs7() { | ||
| use nix::sys::termios::{ControlFlags, SetArg, tcgetattr, tcsetattr}; |
There was a problem hiding this comment.
Would you use rustix instead of nix at test_stty.rs?
6bc2628 to
0733938
Compare
Clear a grouped setting’s mask before applying its selected value. Character sizes (cs5–cs8) and output delay settings now replace the previous value while preserving unrelated flags.
Closes #11963