Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/uu/stty/src/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -355,4 +355,5 @@ pub const COMBINATION_SETTINGS: &[(&str, bool)] = &[
("pass8", true),
("raw", true),
("sane", false),
("tabs", true),
];
6 changes: 6 additions & 0 deletions src/uu/stty/src/stty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 17 additions & 0 deletions tests/by-util/test_stty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
Loading