[PR #891] Add support for OSC 10 and 11 to set the default colors #24367

Open
opened 2026-01-31 09:02:50 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/891

State: closed
Merged: Yes


Add support for OSC 10 and 11 to set the default colors

Supports setting the rgb value for the default foreground and background (but no support for querying yet, same as OSC 4)

PR Checklist

  • Closes When scrolling vim, text is not displayed properly. (#317)
  • CLA signed. If not, go over here and sign the CLA
  • Tests added/passed
  • Requires documentation to be updated
  • I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #317

This adds support for OSC 10 to set the default foreground color and OSC 11 to set the default background color (just as if they were set in the profiles.json, except that the settings are not changes, so they can be reloaded).

I have not implemented querying (which is also mentioned in #317), so this only addresses one item in the list.

I have not really added any unit tests -- I'm happy to do so, but unsure where they should go, or what they look like. I found some mocks for the other OSC codes, and implemented those, but didn't spot tests.

**Original Pull Request:** https://github.com/microsoft/terminal/pull/891 **State:** closed **Merged:** Yes --- <!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? --> ## Add support for OSC 10 and 11 to set the default colors Supports setting the rgb value for the default foreground and background (but no support for querying yet, same as OSC 4) <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist * [x] Closes #317 * [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [ ] Tests added/passed * [x] Requires documentation to be updated * [x] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #317 <!-- Provide a more detailed description of the PR, other things fixed or any additional comments/features here --> This adds support for OSC 10 to set the default foreground color and OSC 11 to set the default background color (just as if they were set in the profiles.json, except that the settings are not changes, so they can be reloaded). I have not implemented querying (which is also mentioned in #317), so this only addresses one item in the list. I have not really added any unit tests -- I'm happy to do so, but unsure where they should go, or what they look like. I found some mocks for the other OSC codes, and implemented those, but didn't spot tests.
claunia added the pull-request label 2026-01-31 09:02:50 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#24367