Ignore input_delay when the input buffer is close to full

This commit is contained in:
Kovid Goyal
2023-11-09 22:44:06 +05:30
parent 822c9cb1d6
commit dbc4b98742
2 changed files with 2 additions and 2 deletions

View File

@@ -867,7 +867,7 @@ Delay before input from the program running in the terminal is processed (in
milliseconds). Note that decreasing it will increase responsiveness, but also
increase CPU usage and might cause flicker in full screen programs that redraw
the entire screen on each loop, because kitty is so fast that partial screen
updates will be drawn.
updates will be drawn. This setting is ignored when the input buffer is almost full.
'''
)

View File

@@ -1611,7 +1611,7 @@ run_worker(void *p, ParseData *pd, bool flush) {
if (self->read.consumed < self->read.sz) {
self->dump_callback = pd->dump_callback; self->now = pd->now;
pd->time_since_new_input = pd->now - self->new_input_at;
if (flush || pd->time_since_new_input >= OPT(input_delay)) {
if (flush || pd->time_since_new_input >= OPT(input_delay) || (BUF_SZ - self->read.sz) <= 16 * 1024) {
bool buf_full = self->read.sz >= BUF_SZ;
pd->input_read = true;
do_parse_vt(self);