Skip to content

Commit

Permalink
lots of debug output
Browse files Browse the repository at this point in the history
  • Loading branch information
th1000s committed Mar 31, 2022
1 parent facd864 commit 48974b0
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/options/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -610,25 +610,25 @@ fn windows_msys2_width_fix(height_width: (u16, u16)) -> (u16, u16) {
let term = std::env::var("TERM").ok()?;
if term.starts_with("xterm") {
// read stderr, in case stdout is piped somewhere again
let result = Command::new("stty")
let result = dbg!(Command::new("stty")
.stderr(Stdio::inherit())
.arg("-F")
.arg("/dev/fd/2")
.arg("size")
.output()
.ok()?;
.output())
.ok()?;

if result.status.success() {
let size = std::str::from_utf8(&result.stdout).ok()?;
if dbg!(&result).status.success() {
let size = dbg!(std::str::from_utf8(&result.stdout)).ok()?;
let mut it = size.split_whitespace();
let _height = it.next()?;
return it.next().map(|width| width.parse().ok())?;
return dbg!(it.next().map(|width| width.parse().ok()))?;
}
}
None
}

match height_width {
match dbg!(height_width) {
(h, w) if h == 24 || h == 25 && w == 79 || w == 80 => (h, guess_real_width().unwrap_or(w)),
_ => height_width,
}
Expand Down

0 comments on commit 48974b0

Please sign in to comment.