mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-08-02 05:57:46 +00:00
Fix broken terminal in tests
This commit is contained in:
parent
c930509095
commit
7a88df9fb4
1 changed files with 3 additions and 3 deletions
|
@ -133,8 +133,8 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
||||||
)
|
)
|
||||||
.get_matches_from(args);
|
.get_matches_from(args);
|
||||||
let mut buff = String::new();
|
let mut buff = String::new();
|
||||||
let mut stdout = setup_term();
|
|
||||||
if let Some(filenames) = matches.values_of(options::FILES) {
|
if let Some(filenames) = matches.values_of(options::FILES) {
|
||||||
|
let mut stdout = setup_term();
|
||||||
let length = filenames.len();
|
let length = filenames.len();
|
||||||
for (idx, fname) in filenames.clone().enumerate() {
|
for (idx, fname) in filenames.clone().enumerate() {
|
||||||
let fname = Path::new(fname);
|
let fname = Path::new(fname);
|
||||||
|
@ -163,11 +163,11 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
||||||
}
|
}
|
||||||
reset_term(&mut stdout);
|
reset_term(&mut stdout);
|
||||||
} else if atty::isnt(atty::Stream::Stdin) {
|
} else if atty::isnt(atty::Stream::Stdin) {
|
||||||
let mut stdout = setup_term();
|
|
||||||
stdin().read_to_string(&mut buff).unwrap();
|
stdin().read_to_string(&mut buff).unwrap();
|
||||||
|
let mut stdout = setup_term();
|
||||||
more(&buff, &mut stdout, true);
|
more(&buff, &mut stdout, true);
|
||||||
|
reset_term(&mut stdout);
|
||||||
} else {
|
} else {
|
||||||
terminal::disable_raw_mode().unwrap();
|
|
||||||
show_usage_error!("bad usage");
|
show_usage_error!("bad usage");
|
||||||
}
|
}
|
||||||
0
|
0
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue