Respond to OSC 10 (fg color), OSC 11 (bg color) and OSC 4 (256-color) queries#55
Respond to OSC 10 (fg color), OSC 11 (bg color) and OSC 4 (256-color) queries#55
OSC 10 (fg color), OSC 11 (bg color) and OSC 4 (256-color) queries#55Conversation
|
Thanks for your contribution. Do you have an application that uses this, to check that it works? |
Yup! I have a Python + curses TUI 3-way merge tool I'm developing that uses this functionality to pick a suitable selection highlight color. Here's a before and after running it in GtkStm: Beforetuimerge fails to read the background color with
Aftertuimerge succeeds at querying the background color, so computes a subtle highlight color from it.
And a quick hack to
Other examplesHere is that same code, adapting to the background color of Ghostty and modifying the palette entry for a closer match, to show that the code that works after this PR also works on other terminals:
|
Add do_osc_internal() for handling certain OSC commands within libtsm instead of delegating them to osc_cb. Fix Aetf#53
537b3cc to
28b466a
Compare
|
Just pushed a few small style cleanups. Works exactly the same, tests still pass. |
|
I was just looking over the source for msedit and found that it uses |
This is in preparation for OSC 4 ? query support.
OSC 10 (fg color) and OSC 11 (bg color) queriesOSC 10 (fg color) and OSC 11 (bg color) and OSC 4 (256-color) queries
OSC 10 (fg color) and OSC 11 (bg color) and OSC 4 (256-color) queriesOSC 10 (fg color), OSC 11 (bg color) and OSC 4 (256-color) queries
bc13712 to
1ddb70e
Compare
|
Woke up this morning and realized I didn't love the structure of my OSC4 parser, so I made some tweaks. I'm done with this for now, pending change requests. |












do_osc_internal()for handling certainOSCcommands within libtsm instead of delegating them tovte->osc_cb().OSC 10(fg color) andOSC 11(bg color) queriesFix #53