[PR #11991] Use the correct background color when copying to clipboard #28822

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

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

State: closed
Merged: Yes


When copying content from the terminal to the clipboard (with
formatting), a default background color needs to be set to fill the
unused area of the pasted block. Prior to this PR, that color was not
correctly set, so the pasted content did not match what was seen on
screen.

Windows Terminal previously used the default background from the initial
color scheme, so it didn't take palette changes into account.
OpenConsole did use the active default color, but didn't take the
reverse screen mode into account, so could end up using the foreground
rather than the background color.

In both case I've changed the code to lookup the runtime colors in the
same way that renderer does, so they should now match what is seen on
screen.

Validation Steps Performed

I've manually confirmed that the background color is now correctly set
when copying from both Windows Terminal and OpenConsole.

Closes #11988

**Original Pull Request:** https://github.com/microsoft/terminal/pull/11991 **State:** closed **Merged:** Yes --- When copying content from the terminal to the clipboard (with formatting), a default background color needs to be set to fill the unused area of the pasted block. Prior to this PR, that color was not correctly set, so the pasted content did not match what was seen on screen. Windows Terminal previously used the default background from the initial color scheme, so it didn't take palette changes into account. OpenConsole did use the active default color, but didn't take the reverse screen mode into account, so could end up using the foreground rather than the background color. In both case I've changed the code to lookup the runtime colors in the same way that renderer does, so they should now match what is seen on screen. ## Validation Steps Performed I've manually confirmed that the background color is now correctly set when copying from both Windows Terminal and OpenConsole. Closes #11988
claunia added the pull-request label 2026-01-31 09:30:58 +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#28822