stty: add support for tabs/-tabs combination settings

This commit is contained in:
Sylvestre Ledru
2026-04-09 22:17:23 +02:00
committed by Daniel Hofstetter
parent f22ae8a345
commit 8cc048b43c
3 changed files with 24 additions and 0 deletions
+1
View File
@@ -355,4 +355,5 @@ pub const COMBINATION_SETTINGS: &[(&str, bool)] = &[
("pass8", true),
("raw", true),
("sane", false),
("tabs", true),
];
+6
View File
@@ -1220,6 +1220,12 @@ fn combo_to_flags(combo: &str) -> Vec<ArgOptions<'_>> {
(S::VDISCARD, "^O"),
];
}
"tabs" => {
flags = vec!["tab0"];
}
"-tabs" => {
flags = vec!["tab3"];
}
_ => unreachable!("invalid combination setting: must have been caught earlier"),
}
let mut flags = flags
+17
View File
@@ -947,6 +947,23 @@ fn test_combo_crt() {
.stdout_contains("echoe");
}
#[test]
#[cfg(target_os = "linux")]
fn test_combo_tabs() {
// Test tabs combination setting - tabs is an alias for tab0, -tabs for tab3
new_ucmd!()
.terminal_simulation(true)
.args(&["tabs"])
.succeeds()
.no_stderr();
new_ucmd!()
.terminal_simulation(true)
.args(&["-tabs"])
.succeeds()
.no_stderr();
}
#[test]
#[cfg(unix)]
#[ignore = "Fails because cargo test does not run in a tty"]