Bug 488905

Summary: Feature request: OSC 12 support (Change text cursor color)
Product: [Applications] konsole Reporter: Maxim <sliva0mk>
Component: emulationAssignee: Konsole Developer <konsole-devel>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: 24.05.1   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: xterm, xfce4-terminal, terminator and Konsole

Description Maxim 2024-06-21 16:14:54 UTC
SUMMARY
Konsole already supports OSC 10 and 11 (text fg/bg colors) but doesn't support OSC 110 and 111 (reset for fg/bg colors), and OSC 12 and 112 (text cursor color and reset).

STEPS TO REPRODUCE
1. run the command: printf '\e]12;red\a'

OBSERVED RESULT
Cursor color doesn't change with any Appearence>Cursor settings, unlike in xterm or libvte-based terminals (gnome-terminal, xfce4-terminal, terminator).

EXPECTED RESULT
The cursor color changes the same way as in xterm and libvte.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: EndeavourOS
KDE Plasma Version: 6.1.0
KDE Frameworks Version: 6.3.0
Qt Version: 6.7.1

ADDITIONAL INFORMATION
My use case is I want to change neovim cursor color depending on the mode. I don't care about OSC 110 and 111 support, but this seems adjacent enough to include it in this issue.
Comment 1 Maxim 2024-06-21 16:19:29 UTC
Created attachment 170762 [details]
xterm, xfce4-terminal, terminator and Konsole
Comment 2 Maxim 2024-06-21 16:25:49 UTC
The closest thing I found to the documentation is the "XTerm Control Sequences" pdf file: https://invisible-island.net/xterm/ctlseqs/ctlseqs.pdf, pages 34-36.
Comment 3 Bug Janitor Service 2024-09-14 10:32:20 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/konsole/-/merge_requests/1029
Comment 4 Matan Ziv-Av 2024-09-14 20:41:05 UTC
Git commit a213c3df04cd608f6db7e2ae6d407f4c420cc431 by Matan Ziv-Av.
Committed on 14/09/2024 at 10:28.
Pushed by hindenburg into branch 'master'.

Add support for setting the cursor color (OSC 12)

Parse OSC 12 and set the cursor color accordingly.

M  +12   -0    src/Vt102Emulation.cpp
M  +1    -0    src/Vt102Emulation.h

https://invent.kde.org/utilities/konsole/-/commit/a213c3df04cd608f6db7e2ae6d407f4c420cc431