[konsole] [Bug 499122] New: OSC 4 response uses incorrect terminator character
Egmont Koblinger
bugzilla_noreply at kde.org
Sat Jan 25 09:42:48 GMT 2025
https://bugs.kde.org/show_bug.cgi?id=499122
Bug ID: 499122
Summary: OSC 4 response uses incorrect terminator character
Classification: Applications
Product: konsole
Version: master
Platform: Other
OS: Linux
Status: REPORTED
Severity: normal
Priority: NOR
Component: emulation
Assignee: konsole-devel at kde.org
Reporter: egmont at gmail.com
Target Milestone: ---
SUMMARY
OSC 4 response (to get the RGB value of a particular palette color) uses
incorrect terminator character, BEL instead of ST.
The official terminator for OSC is ST, that is, ESC followed by Backslash. BEL
is a nonstandard variant used sometimes.
For OSC 10 and 11 queries (to get the RGB value of the default foreground and
background colors), Konsole echoes back the terminator seen in the query. For
OSC 4 the response always contains the incorrect terminator. So Konsole is even
inconsistent with itself.
When parsing such sequences, it's great that Konsole accepts both variants.
When emitting, please be consistent: either always echo back the query's format
(as you do now for OSC 10/11), or maybe always use the correct format (for all
of OSC 4/10/11, then). But please don't respond to a correct query with an
incorrect response.
STEPS TO REPRODUCE
Run this script:
#!/bin/bash
stty raw
printf '\e]4;0;?\e\\'
IFS='' read -r -t 1
stty cooked
echo
This emits an OSC 4 query (asking for the RGB value of palette index 0 in this
example), to which the terminal responds with an OSC 4 as if you'd typed it
from your keyboard.
For your convenience, this little script makes the response appear in the
terminal, and reads and swallows those characters so that they don't mess with
your next command.
OBSERVED RESULT
^[]4;0;rgb:0000/0000/0000^G
EXPECTED RESULT
^[]4;0;rgb:0000/0000/0000^[\
(The actual color might differ, of course.)
SOFTWARE/OS VERSIONS
Konsole version 09f91397188 (just built from git master)
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the konsole-devel
mailing list