From dd0546bbc205601423d5281133c73f83196d1aaa Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Thu, 1 Nov 2018 06:20:19 -0700 Subject: repl: bugfix: slow paste into terminal window. * stream.c (stream_init): When stdin is a TTY, we make it unbuffered. This affects the parenthesis matching and incomplete line warning flash in the listener, in the following way. The listener uses the poll function to execute delays which is canceled by the presence of TTY input. This logic breaks when data is pasted into the terminal, because the stdin stream buffers the input. --- stream.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'stream.c') diff --git a/stream.c b/stream.c index 3887e77f..69c891bf 100644 --- a/stream.c +++ b/stream.c @@ -4533,8 +4533,10 @@ void stream_init(void) reg_var(print_circle_s = intern(lit("*print-circle*"), user_package), nil); #if HAVE_ISATTY - if (isatty(fileno(stdin)) == 1) + if (isatty(fileno(stdin)) == 1) { stream_set_prop(std_input, real_time_k, t); + setbuf(stdin, 0); + } #endif reg_fun(format_s, func_n2v(formatv)); -- cgit v1.2.3