From c6af6c08045a780ac5b8c4f56ae0383997cdb091 Mon Sep 17 00:00:00 2001 From: Lars Kellogg-Stedman Date: Wed, 16 Oct 2019 22:48:44 -0400 Subject: [PATCH] fflush() after putchar() for print_hex and print_normal In order for local echo to work properly, we have to either call fflush(stdout) after every character or just disable line buffering. This change calls fflush() after putchar(). Closes #92 --- src/tty.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/tty.c b/src/tty.c index bee6f9f..3dbe145 100644 --- a/src/tty.c +++ b/src/tty.c @@ -70,11 +70,13 @@ static bool map_o_del_bs = false; static void print_hex(char c) { printf("%02x ", (unsigned char) c); + fflush(stdout); } static void print_normal(char c) { putchar(c); + fflush(stdout); } void handle_command_sequence(char input_char, char previous_char, char *output_char, bool *forward)