Skip to content

Commit

Permalink
Use out.as_raw_fd() to get size in unix_term (#186)
Browse files Browse the repository at this point in the history
  • Loading branch information
tgolsson committed Jan 9, 2024
1 parent 0567bdc commit 8e1b33d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## Unreleased

### Bugfixes

* Properly use configured output of `Term` to get terminal size (#186)

## 0.15.7

### Enhancements
Expand Down
2 changes: 1 addition & 1 deletion src/unix_term.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ pub fn c_result<F: FnOnce() -> libc::c_int>(f: F) -> io::Result<()> {

pub fn terminal_size(out: &Term) -> Option<(u16, u16)> {
unsafe {
if libc::isatty(libc::STDOUT_FILENO) != 1 {
if libc::isatty(out.as_raw_fd()) != 1 {
return None;
}

Expand Down

0 comments on commit 8e1b33d

Please sign in to comment.