зеркало из https://github.com/microsoft/terminal.git
3b4ee83ed1
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 |
||
---|---|---|
.. | ||
ISSUE_TEMPLATE | ||
actions/spelling | ||
linters | ||
policies | ||
workflows | ||
PULL_REQUEST_TEMPLATE.md |