diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2017-05-30 10:35:35 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2017-05-30 10:35:35 +0200 |
| commit | 554d6b887d1d56de330f63bf735ef96ab10cacd2 (patch) | |
| tree | 74737115b49afa2af86a3d905fac9b91196a384e /ui-terminal.c | |
| parent | 25bc0ce529835cd9c46058a6dd1026c0bc247461 (diff) | |
| download | vis-554d6b887d1d56de330f63bf735ef96ab10cacd2.tar.gz vis-554d6b887d1d56de330f63bf735ef96ab10cacd2.tar.xz | |
ui: reopen terminal read-writeable
libtermkey fails if the terminal file descriptor is read only.
This should fix the `v` command in less(1).
Diffstat (limited to 'ui-terminal.c')
| -rw-r--r-- | ui-terminal.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ui-terminal.c b/ui-terminal.c index 6a4331f..8cdd655 100644 --- a/ui-terminal.c +++ b/ui-terminal.c @@ -649,7 +649,7 @@ static bool ui_init(Ui *ui, Vis *vis) { errno = 0; if (!(tui->termkey = ui_termkey_new(STDIN_FILENO))) { /* work around libtermkey bug which fails if stdin is /dev/null */ - if (errno == EBADF && !isatty(STDIN_FILENO)) { + if (errno == EBADF) { errno = 0; if (!(tui->termkey = ui_termkey_reopen(ui, STDIN_FILENO)) && errno == ENXIO) tui->termkey = termkey_new_abstract(term, UI_TERMKEY_FLAGS); |
