From 554d6b887d1d56de330f63bf735ef96ab10cacd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Tue, 30 May 2017 10:35:35 +0200 Subject: ui: reopen terminal read-writeable libtermkey fails if the terminal file descriptor is read only. This should fix the `v` command in less(1). --- ui-terminal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- cgit v1.2.3