Skip to content

Conversation

@j4james
Copy link
Collaborator

@j4james j4james commented May 13, 2025

Summary of the Pull Request

The SGR 1 VT attribute can either be interpreted as a brighter color,
or as a bolder font, depending on the Intense text style setting.
However, the concept of brightness only applies to the eight standard
ANSI colors, so when SGR 1 is configured as bright, it has no effect
on the ITU T.416 colors (RGB and the 256 index colors).

To address that, we now interpret SGR 1 as a bolder font when applied
to ITU colors, regardless of whether the Intense text style option is
set to bold or not.

Note that this only applies to the Atlas render engine, since the GDI
engine doesn't support bold fonts.

Validation Steps Performed

I've manually tested SGR 1 applied to different color formats with the
Intense text style option set to None, and confirmed that the text
is now rendered with a bold font for ITU colors, but not for ANSI/AIX
colors.

PR Checklist

Copy link
Member

@DHowett DHowett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using the architecture you built yourself, you make this look easy.

Thanks for doing this. I know bold/intense/the true definition of SGR 1 is contentious, so let's see how this one goes over. 🙂

@DHowett
Copy link
Member

DHowett commented May 13, 2025

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@j4james
Copy link
Collaborator Author

j4james commented May 13, 2025

Yeah, I don't think this is likely to be a problem, because it doesn't have the history of ambiguity that SGR 1 with ANSI colors had, but if anyone does complain, we can always add another option for it later.

I did consider maybe using the existing None option to disable it, but it's possible someone still wants bright with ANSI colors, but no bold on ITU colors, so that would require a completely separate toggle. So for now I figured it was best to keep it simple and see what happens.

@DHowett DHowett enabled auto-merge (squash) May 13, 2025 17:45
@github-project-automation github-project-automation bot moved this to To Cherry Pick in 1.23 Servicing Pipeline May 13, 2025
@DHowett DHowett merged commit 07c9a99 into microsoft:main May 13, 2025
12 of 14 checks passed
@DHowett DHowett moved this from To Cherry Pick to Cherry Picked in 1.23 Servicing Pipeline May 13, 2025
DHowett pushed a commit that referenced this pull request May 13, 2025
The `SGR 1` VT attribute can either be interpreted as a brighter color,
or as a bolder font, depending on the _Intense text style_ setting.
However, the concept of brightness only applies to the eight standard
ANSI colors, so when `SGR 1` is configured as _bright_, it has no effect
on the ITU T.416 colors (RGB and the 256 index colors).

To address that, we now interpret `SGR 1` as a bolder font when applied
to ITU colors, regardless of whether the _Intense text style_ option is
set to bold or not.

Note that this only applies to the Atlas render engine, since the GDI
engine doesn't support bold fonts.

## Validation Steps Performed

I've manually tested `SGR 1` applied to different color formats with the
_Intense text style_ option set to _None_, and confirmed that the text
is now rendered with a bold font for ITU colors, but not for ANSI/AIX
colors.

Closes #18284

(cherry picked from commit 07c9a99)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgaWKqk
Service-Version: 1.23
@DHowett DHowett moved this from Cherry Picked to Shipped in 1.23 Servicing Pipeline Sep 5, 2025
@ianisl
Copy link

ianisl commented Oct 15, 2025

Hi, just found this update. This makes text appear bold in unexpected places, for instance in Vim when using fzf:
2025-10-15_143916
I don't like the effect. Is there a way to disable the new setting?

@lhecker
Copy link
Member

lhecker commented Oct 15, 2025

But why would vim use SGR 1 with an ITU color in the first place? Brightening an ITU color doesn't make much sense to me... Shouldn't this perhaps get fixed in vim / your vim plugin?

@ianisl
Copy link

ianisl commented Oct 15, 2025

It's apparently an issue in Vim's built-in terminal which is used by fzf.
I admit it's a bit above my understanding of terminal colors but here's what seems a relevant (old) issue: vim/vim#5929
I don't think this will get fixed on Vim's side.

@ianisl
Copy link

ianisl commented Oct 15, 2025

Posting this since this could help others: I found a temporary workaround by disabling the emission of the SGR 1 attribute by Vim, using let &t_md = "".
It's not ideal but it does the job for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

Use Bold To Mean Bold Text Where It Is Currently Ignored

4 participants