mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
stty: add support for tabs/-tabs combination settings
This commit is contained in:
committed by
Daniel Hofstetter
parent
f22ae8a345
commit
8cc048b43c
@@ -355,4 +355,5 @@ pub const COMBINATION_SETTINGS: &[(&str, bool)] = &[
|
||||
("pass8", true),
|
||||
("raw", true),
|
||||
("sane", false),
|
||||
("tabs", true),
|
||||
];
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"]
|
||||
|
||||
Reference in New Issue
Block a user