aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2017-05-30 10:35:35 +0200
committerMarc André Tanner <mat@brain-dump.org>2017-05-30 10:35:35 +0200
commit554d6b887d1d56de330f63bf735ef96ab10cacd2 (patch)
tree74737115b49afa2af86a3d905fac9b91196a384e
parent25bc0ce529835cd9c46058a6dd1026c0bc247461 (diff)
downloadvis-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).
-rw-r--r--ui-terminal.c2
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);