edit icon indicating copy to clipboard operation
edit copied to clipboard

Subscribe to Contour color palette update notifications

Open Vixb1122 opened this issue 2 months ago • 4 comments

Vixb1122 avatar Oct 22 '25 07:10 Vixb1122

Well, we can't just poll the terminal for its theme every time we render (too much traffic) and there's no event that we receive for when the theme changes. In my opinion, TUI applications are not supposed to handle this edge case.

lhecker avatar Oct 22 '25 09:10 lhecker

Understand, this is not necessary.

Vixb1122 avatar Oct 22 '25 09:10 Vixb1122

@lhecker well, Contour implements something:

Send CSI ? 2031 h to the terminal to enable unsolicited DSR (device status report) messages for color palette updates and CSI ? 2031 l respectively to disable it again.

DHowett avatar Oct 22 '25 16:10 DHowett

FYI, that Contour extension is quite widely used by TUI libraries and applications, and I think there are one or two more terminals supporting it that aren't currently listed in the adoption table. Windows Terminal has an open issue for it here: https://github.com/microsoft/terminal/issues/18375

j4james avatar Oct 22 '25 20:10 j4james