1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-27 19:17:43 +00:00

Merge pull request #8221 from willshuttleworth/stty-size

stty: add options to set and print terminal size
This commit is contained in:
Daniel Hofstetter 2025-06-19 16:59:00 +02:00 committed by GitHub
commit 39c793c885
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 119 additions and 1 deletions

View file

@ -48,6 +48,14 @@ fn all_and_setting() {
.stderr_contains("when specifying an output style, modes may not be set");
}
#[test]
fn all_and_print_setting() {
new_ucmd!()
.args(&["--all", "size"])
.fails()
.stderr_contains("when specifying an output style, modes may not be set");
}
#[test]
fn save_and_all() {
new_ucmd!()
@ -201,3 +209,37 @@ fn set_mapping() {
.succeeds()
.stdout_contains("intr = ^C");
}
#[test]
fn row_column_sizes() {
new_ucmd!()
.args(&["rows", "-1"])
.fails()
.stderr_contains("invalid integer argument: '-1'");
new_ucmd!()
.args(&["columns", "-1"])
.fails()
.stderr_contains("invalid integer argument: '-1'");
// overflow the u32 used for row/col counts
new_ucmd!()
.args(&["cols", "4294967296"])
.fails()
.stderr_contains("invalid integer argument: '4294967296'");
new_ucmd!()
.args(&["rows", ""])
.fails()
.stderr_contains("invalid integer argument: ''");
new_ucmd!()
.args(&["columns"])
.fails()
.stderr_contains("missing argument to 'columns'");
new_ucmd!()
.args(&["rows"])
.fails()
.stderr_contains("missing argument to 'rows'");
}