diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2018-11-01 06:20:19 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2018-11-01 06:20:19 -0700 |
commit | dd0546bbc205601423d5281133c73f83196d1aaa (patch) | |
tree | f1f555fa5da0f90485983fb07861c91ce36bc4ae /stream.c | |
parent | 157e051e3cb9232509b6df1dd57f4ae172809f25 (diff) | |
download | txr-dd0546bbc205601423d5281133c73f83196d1aaa.tar.gz txr-dd0546bbc205601423d5281133c73f83196d1aaa.tar.bz2 txr-dd0546bbc205601423d5281133c73f83196d1aaa.zip |
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.
Diffstat (limited to 'stream.c')
-rw-r--r-- | stream.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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)); |