Commit c44dc0b
authored
Use TIOCGWINSZ instead of TCGETS to detect terminals (#97)
TCGETS shares its ioctl number with SNDCTL_TMR_TIMEBASE of the OSS
sound API, so it may succeed (and even change the device mode) on
certain non-tty devices. TIOCGWINSZ has no such conflict and succeeds
on any tty. musl's isatty does the same.
Fixes #761 parent 4bc9b75 commit c44dc0b
1 file changed
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
11 | 15 | | |
12 | | - | |
| 16 | + | |
13 | 17 | | |
14 | 18 | | |
15 | 19 | | |
| |||
0 commit comments