diff --git a/kitty/parser.c b/kitty/parser.c index 7e73e5c04..3a1c80195 100644 --- a/kitty/parser.c +++ b/kitty/parser.c @@ -610,7 +610,9 @@ FNAME(read_bytes)(PyObject UNUSED *self, PyObject *args) { #endif while(true) { + Py_BEGIN_ALLOW_THREADS; len = read(fd, screen->read_buf, READ_BUF_SZ); + Py_END_ALLOW_THREADS; if (len == -1) { if (errno == EINTR) continue; if (errno == EIO) { Py_RETURN_FALSE; }