-
Notifications
You must be signed in to change notification settings - Fork 8.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for querying Xterm dynamic colors and palette (#17729)
This pull request adds support for querying all of the "dynamic resource" colors (foreground, background, cursor) as well as the entire color palette using OSC 4, 10, 11 and 12 with the `?` color specifier. To ease integration and to make it easier to extend later, I have consolidated `SetDefaultForeground`, `SetDefaultBackground` and `SetCursorColor` into one function `SetXtermColorResource`, plus its analog `RequestXtermColorResource`. Those functions will map xterm resource OSC numbers to color table entries and optionally color _alias_ entries using a constant table. The alias mappings are required to support reassigning the default foreground and background to their indexed entries after a `DECAC`. While there are only three real entries in the mapping table right now, I have designs on bringing in selection background (xterm "highlight") and foreground (xterm "highlightText"). We can also extend this to support resetting via OSC 110-119. However, at the adapter layer we do not have the requisite information to restore any of the colors (even the cursor color!) to the user's defaults. `OSC 10` and `OSC 11` queries report the final values of `DECAC`-reassigned entries, under the assumption that an application asking for them wants to make a determination regardless of their internal meaning to us (that is: they read through the aliased color to its final destination in the color palette.) I've tested this with lsix, which detects the background color before generating sixel previews. It works great! ConPTY does not currently pass OSC sequences received on the input handle, so work was required to make it do so. Closes #3718
- Loading branch information
Showing
10 changed files
with
562 additions
and
172 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.