From 812fe467c9edba6f22184afe38d9d9b80c15aec9 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 9 Mar 2025 19:02:19 +0530 Subject: [PATCH] Report OSC 6/106 as ignored only once --- kitty/vt-parser.c | 8 +++++++- tools/cmd/benchmark/main.go | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/kitty/vt-parser.c b/kitty/vt-parser.c index 90a783670..863a5a65c 100644 --- a/kitty/vt-parser.c +++ b/kitty/vt-parser.c @@ -493,7 +493,13 @@ dispatch_osc(PS *self, uint8_t *buf, size_t limit, bool is_extended_osc) { DISPATCH_OSC(set_title); END_DISPATCH case 5: case 105: REPORT_ERROR("Ignoring OSC 5/105, used by XTerm to change special colors used for rendering bold/italic/underline"); break; - case 6: case 106: REPORT_ERROR("Ignoring OSC 6/106, used by XTerm to enable/disable special colors used for rendering bold/italic/underline"); break; + case 6: case 106: { // report only once as this is used by benchmark kitten causing log spam + static bool reported = false; + if (!reported) { + reported = true; + REPORT_ERROR("Ignoring OSC 6/106, used by XTerm to enable/disable special colors used for rendering bold/italic/underline"); + } + } break; case 4: case 104: START_DISPATCH diff --git a/tools/cmd/benchmark/main.go b/tools/cmd/benchmark/main.go index bee48fe91..1e4ce4e6d 100644 --- a/tools/cmd/benchmark/main.go +++ b/tools/cmd/benchmark/main.go @@ -209,7 +209,7 @@ func images() (r result, err error) { func long_escape_codes() (r result, err error) { data := random_string_of_bytes(8024, ascii_printable) - // OSC 6 is document reporting which kitty ignores after parsing + // OSC 6 is document reporting or XTerm special color which kitty ignores after parsing data = strings.Repeat("\x1b]6;"+data+"\x07", 1024) const desc = "Long escape codes" duration, data_sz, reps, err := benchmark_data(desc, data, opts)