Skip to content

Commit 8e1b33d

Browse files
authored
Use out.as_raw_fd() to get size in unix_term (#186)
1 parent 0567bdc commit 8e1b33d

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## Unreleased
4+
5+
### Bugfixes
6+
7+
* Properly use configured output of `Term` to get terminal size (#186)
8+
39
## 0.15.7
410

511
### Enhancements

src/unix_term.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ pub fn c_result<F: FnOnce() -> libc::c_int>(f: F) -> io::Result<()> {
4646

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

0 commit comments

Comments
 (0)