When copying text from the terminal, the colours in the HTML in the clipboard are too dim #23871

Closed
opened 2026-01-31 08:54:45 +00:00 by claunia · 4 comments
Owner

Originally created by @BladeMF on GitHub (Dec 9, 2025).

Windows Terminal version

1.23.12811.0

Windows build number

10.0.26100.0

Other Software

No response

Steps to reproduce

  1. Enble HTML in "Text formats to copy to clipboard"
  2. Copy text
  3. Paste it in OneNote or Word in a box with the same background as the terminal.

Expected Behavior

The colors should look exactly the same given the same background.

Actual Behavior

OneNote seems to change the colors to dimmer ones. If I then fix the colors in OneNote and copy it agian, they don't change.
OneNote version: Microsoft® OneNote® for Microsoft 365 MSO (Version 2511 Build 16.0.19426.20118) 64-bit

Originally created by @BladeMF on GitHub (Dec 9, 2025). ### Windows Terminal version 1.23.12811.0 ### Windows build number 10.0.26100.0 ### Other Software _No response_ ### Steps to reproduce 1. Enble HTML in "Text formats to copy to clipboard" 2. Copy text 3. Paste it in OneNote or Word in a box with the same background as the terminal. ### Expected Behavior The colors should look exactly the same given the same background. ### Actual Behavior OneNote seems to change the colors to dimmer ones. If I then fix the colors in OneNote and copy it agian, they don't change. OneNote version: `Microsoft® OneNote® for Microsoft 365 MSO (Version 2511 Build 16.0.19426.20118) 64-bit `
claunia added the Needs-TriageIssue-Bug labels 2026-01-31 08:54:45 +00:00
Author
Owner

@BladeMF commented on GitHub (Dec 9, 2025):

Note sure what in the format makes OneNote change the colours. Examples:

Source:

Version:0.9
StartHTML:0000000157
EndHTML:0000000690
StartFragment:0000000192
EndFragment:0000000676
StartSelection:0000000192
EndSelection:0000000676
<!DOCTYPE><HTML><HEAD></HEAD><BODY><!--StartFragment --><DIV STYLE="display:inline-block;white-space:pre;background-color:#0C0C0C;font-family:'Cascadia Code NF',monospace;font-size:9pt;padding:4px;"><SPAN STYLE="color:#13A10E;background-color:#0C0C0C;">[  SUCCESSFUL] SQLServerBackupRestoreTests.DescribeTestPointInTimeRestoreDatabaseCases    23.244572ms</SPAN><BR><SPAN STYLE="color:#C50F1F;background-color:#0C0C0C;">[      FAILED] AutoupgradeTests.TestAutoupgrade    2h30m0.006110297s</SPAN></DIV><!--EndFragment --></BODY></HTML>

Result (pasted and then copied back)

Version:1.0
StartHTML:0000000105
EndHTML:0000001198
StartFragment:0000000541
EndFragment:0000001158

<html xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"
xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<meta name=ProgId content=OneNote.File>
<meta name=Generator content="Microsoft OneNote 15">
</head>

<body lang=bg style='font-family:"Segoe UI Variable Text";font-size:11.0pt'>
<!--StartFragment-->

<p style='margin:0in;font-family:"Cascadia Code NF";font-size:9.0pt;color:#A9DDA7'
lang=en-US><span style='background:#0C0C0C'>[<span style='mso-spacerun:yes'> 
</span>SUCCESSFUL]
SQLServerBackupRestoreTests.DescribeTestPointInTimeRestoreDatabaseCases<span
style='mso-spacerun:yes'>    </span>23.244572ms</span></p>

<p style='margin:0in;font-family:"Cascadia Code NF";font-size:9.0pt;color:#F2CACD'><span
style='background:#0C0C0C'>[<span style='mso-spacerun:yes'>      </span>FAILED]
AutoupgradeTests.TestAutoupgrade<span style='mso-spacerun:yes'>   
</span>2h30m0.006110297s</span></p>

<!--EndFragment-->
</body>

</html>

The more interesting bitis that if I copy it from Word it also gets changed, but not if I fix the in OneNote and then copy and paste them.

@BladeMF commented on GitHub (Dec 9, 2025): Note sure what in the format makes OneNote change the colours. Examples: #### Source: ``` Version:0.9 StartHTML:0000000157 EndHTML:0000000690 StartFragment:0000000192 EndFragment:0000000676 StartSelection:0000000192 EndSelection:0000000676 <!DOCTYPE><HTML><HEAD></HEAD><BODY><!--StartFragment --><DIV STYLE="display:inline-block;white-space:pre;background-color:#0C0C0C;font-family:'Cascadia Code NF',monospace;font-size:9pt;padding:4px;"><SPAN STYLE="color:#13A10E;background-color:#0C0C0C;">[ SUCCESSFUL] SQLServerBackupRestoreTests.DescribeTestPointInTimeRestoreDatabaseCases 23.244572ms</SPAN><BR><SPAN STYLE="color:#C50F1F;background-color:#0C0C0C;">[ FAILED] AutoupgradeTests.TestAutoupgrade 2h30m0.006110297s</SPAN></DIV><!--EndFragment --></BODY></HTML> ``` #### Result (pasted and then copied back) ``` Version:1.0 StartHTML:0000000105 EndHTML:0000001198 StartFragment:0000000541 EndFragment:0000001158 <html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns="http://www.w3.org/TR/REC-html40"> <head> <meta http-equiv=Content-Type content="text/html; charset=utf-8"> <meta name=ProgId content=OneNote.File> <meta name=Generator content="Microsoft OneNote 15"> </head> <body lang=bg style='font-family:"Segoe UI Variable Text";font-size:11.0pt'> <!--StartFragment--> <p style='margin:0in;font-family:"Cascadia Code NF";font-size:9.0pt;color:#A9DDA7' lang=en-US><span style='background:#0C0C0C'>[<span style='mso-spacerun:yes'>  </span>SUCCESSFUL] SQLServerBackupRestoreTests.DescribeTestPointInTimeRestoreDatabaseCases<span style='mso-spacerun:yes'>    </span>23.244572ms</span></p> <p style='margin:0in;font-family:"Cascadia Code NF";font-size:9.0pt;color:#F2CACD'><span style='background:#0C0C0C'>[<span style='mso-spacerun:yes'>      </span>FAILED] AutoupgradeTests.TestAutoupgrade<span style='mso-spacerun:yes'>    </span>2h30m0.006110297s</span></p> <!--EndFragment--> </body> </html> ``` The more interesting bitis that if I copy it from Word it also gets changed, but not if I fix the in OneNote and then copy and paste them.
Author
Owner

@BladeMF commented on GitHub (Dec 9, 2025):

I closed it by mistake :-( If somebody could reopen this, that'd be nice.

@BladeMF commented on GitHub (Dec 9, 2025): I closed it by mistake :-( If somebody could reopen this, that'd be nice.
Author
Owner

@DHowett commented on GitHub (Dec 9, 2025):

Unfortunately, that's probably what we were going to do anyway unless somebody can come along and point out how we're generating our HTML incorrectly. I see that the colors are all there, intact, unmodified, before OneNote decides to destroy them.

@DHowett commented on GitHub (Dec 9, 2025): Unfortunately, that's probably what we were going to do anyway unless somebody can come along and point out _how_ we're generating our HTML incorrectly. I see that the colors are all there, intact, unmodified, before OneNote decides to destroy them.
Author
Owner

@BladeMF commented on GitHub (Dec 9, 2025):

Yea, my further research showed that as well. Thanks for responding anyway! I do so really enjoy Microsoft Terminal!

@BladeMF commented on GitHub (Dec 9, 2025): Yea, my further research showed that as well. Thanks for responding anyway! I do so really enjoy Microsoft Terminal!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#23871