From a072a6fd2a36c77632a0b4fe5d67d318606734d7 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 13 Oct 2025 04:16:38 +0530 Subject: [PATCH] Dont dump commands when --dump-bytes alone is specified dumping commands flushes and therefore is expensive and might change timing significantly. --- kitty/boss.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kitty/boss.py b/kitty/boss.py index 6532c6572..a586bbd33 100644 --- a/kitty/boss.py +++ b/kitty/boss.py @@ -270,18 +270,20 @@ class DumpCommands: # {{{ def __init__(self, args: CLIOptions): self.draw_dump_buf: list[str] = [] + self.dump_commands = args.dump_commands if args.dump_bytes: self.dump_bytes_to = open(args.dump_bytes, 'wb') def __call__(self, window_id: int, what: str, *a: Any) -> None: if what == 'draw': - self.draw_dump_buf.append(a[0]) + if self.dump_commands: + self.draw_dump_buf.append(a[0]) elif what == 'bytes': self.dump_bytes_to.write(a[0]) self.dump_bytes_to.flush() elif what == 'error': log_error(*a) - else: + elif self.dump_commands: if self.draw_dump_buf: safe_print('draw', ''.join(self.draw_dump_buf)) self.draw_dump_buf = []