Skip to content

Commit

Permalink
Fix readline echo when stdin is redirected
Browse files Browse the repository at this point in the history
Fixes #1229
  • Loading branch information
koutcher committed Oct 29, 2023
1 parent 8ec2597 commit 707c8cd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/display.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
#include "tig/display.h"
#include "tig/watch.h"

#ifdef HAVE_READLINE
#include <readline/readline.h>
#endif /* HAVE_READLINE */

#define MAX_KEYS 2000

static void set_terminal_modes(void);
Expand Down Expand Up @@ -608,6 +612,9 @@ init_tty(void)
if (!opt_tty.file)
die("Failed to open tty for input");
opt_tty.fd = fileno(opt_tty.file);
#ifdef HAVE_READLINE
rl_instream = opt_tty.file;
#endif /* HAVE_READLINE */

/* attributes */
opt_tty.attr = calloc(1, sizeof(struct termios));
Expand Down

0 comments on commit 707c8cd

Please sign in to comment.