Cant flush response in a parser callback as it can cause recursive parsing

This commit is contained in:
Kovid Goyal
2023-07-20 20:51:12 +05:30
parent f4c96715ac
commit 39f7f2d7b4
2 changed files with 2 additions and 2 deletions

View File

@@ -1170,7 +1170,7 @@ accumulate_osc(Screen *screen, uint32_t ch, PyObject DUMP_UNUSED *dump_callback,
default:
if (screen->parser_buf_pos >= PARSER_BUF_SZ - 1) {
if (handle_extended_osc_code(screen)) *extended_osc_code = true;
else REPORT_ERROR("OSC sequence too long, truncating.");
else REPORT_ERROR("OSC sequence too long (> %d bytes) truncating.", PARSER_BUF_SZ);
return true;
}
screen->parser_buf[screen->parser_buf_pos++] = ch;

View File

@@ -164,7 +164,7 @@ class PtyFileTransmission(FileTransmission):
self.pty.callbacks.ftc = self
def write_ftc_to_child(self, payload: FileTransmissionCommand, appendleft: bool = False, use_pending: bool = True) -> bool:
self.pty.write_to_child('\x1b]' + payload.serialize(prefix_with_osc_code=True) + '\x1b\\', flush=True)
self.pty.write_to_child('\x1b]' + payload.serialize(prefix_with_osc_code=True) + '\x1b\\', flush=False)
class TransferPTY(PTY):