Report OSC 6/106 as ignored only once

This commit is contained in:
Kovid Goyal 2025-03-09 19:02:19 +05:30
parent dfd337edf3
commit 812fe467c9
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C
2 changed files with 8 additions and 2 deletions

View file

@ -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

View file

@ -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)