-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add an ENUM setting for disabling rendering "intense" text as bold #10759
Conversation
@@ -256,6 +257,7 @@ namespace Microsoft::Console::Render | |||
D2D1_TEXT_ANTIALIAS_MODE _antialiasingMode; | |||
|
|||
float _defaultTextBackgroundOpacity; | |||
bool _intenseIsBold; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: you can initialize this in the class body if you want.
This sounds wrong to me. If the long term plan is to allow the choice of "none", "bright", "bold", and "all", then the pre-1.10 behavior is "bright" rather than "none". |
Sorry yea, that is a little confusing. Right now, there's only two values that the settings will actually accept - I'm not sure I can fiddle with the enum parsing enough in this PR to make it so the only options are some set of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't forget to update the schema and the docs! (only reason I'm blocking)
Everything else is a suggestion.
Boolean IntenseIsBold; | ||
// Boolean IntenseIsBright; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is IntenseStyle
declared in the Microsoft.Terminal.Settings.Model
instead of the Microsoft.Terminal.Control
namespace? I guess you need to convert the enum into two bools at some point, but it's just weird to see two super similar settings in one place imo.
Maybe I'm not understanding how these mappings work, but if those are the actual values that are going to be saved in the settings file when a user toggles the "Render intense text as bold" option, then surely that setting is guaranteed to be incorrect at some point in the future? For example, if a user turns this option off (so the setting becomes none), If it can't be avoided, so be it. I just wanted to be sure you were aware of the problem. And if I've just misunderstood how it's going to work, sorry for the noise. |
Yea I agree with @j4james , this change of behavior will result in huge amount of bug reports.
Adding the bright setting is likely the correct solution here 😦 |
This pull request has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 7 days of this comment. |
shh bot, I'm coming back to this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't forget to update the schema and the docs! (only reason I'm blocking)
Everything else is a suggestion.
@@ -600,6 +601,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation | |||
|
|||
_renderEngine->SetForceFullRepaintRendering(_settings.ForceFullRepaintRendering()); | |||
_renderEngine->SetSoftwareRendering(_settings.SoftwareRendering()); | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: unnecessary change
Hello @zadjii-msft! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
build failures :( |
<comment>Header for a control to select how "intense" text is formatted (bold, bright, both or none)</comment> | ||
</data> | ||
<data name="Appearance_IntenseTextStyleNone.Content" xml:space="preserve"> | ||
<value>None</value> | ||
<comment>An option to choose from for the "intense text format" setting. When selected, "intense" text will not be rendered differently</comment> | ||
</data> | ||
<data name="Appearance_IntenseTextStyleBold.Content" xml:space="preserve"> | ||
<value>Bold</value> | ||
<comment>An option to choose from for the "intense text format" setting. When selected, "intense" text will be rendered as bold text</comment> | ||
</data> | ||
<data name="Appearance_IntenseTextStyleBright.Content" xml:space="preserve"> | ||
<value>Bright</value> | ||
<comment>An option to choose from for the "intense text format" setting. When selected, "intense" text will be rendered in a brighter color</comment> | ||
</data> | ||
<data name="Appearance_IntenseTextStyleAll.Content" xml:space="preserve"> | ||
<value>Both</value> | ||
<comment>An option to choose from for the "intense text format" setting. When selected, "intense" text will be rendered as both bold text and in a brighter color</comment> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worried about the wording here. The names are pretty short, and people may not know what "Intense Text Format" means. Should we do something more like Display "intense" text in...
...the normal font
a bold font
...bright colors
...both bold font and bright colors
?
Should we get more technical and mention SGR 1?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cinnamon-msft what do you think? this is a button for users who "know what they're doing"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm gonna guess that .1% of our users will know what SGR 1 is. I be 1% of the folks that upvoted #109 in the first place do - people just want bold.
I'm not a wordsmith, I'm just a lowly engineer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a point of comparison, Mintty has this option as a dropdown list with the label "Show bold", and with the choices "as font", "as color", or "as font & as color". XTerm just as the option to toggle the bold fonts (at least in the UI) with a checked menu item labelled "Bold Fonts". And Gnome Terminal just as the option to toggle the bright colors with a checkbox labelled "Show bold text in bright colors".
My recommendation would be something similar to what Mintty has, but with a little more detail, e.g.:
- Show bold with brighter colors
- Show bold with a heavier font weight
- Show bold with both font weight and color
I think most people that are going to want to mess with this know that it's the "bold" functionality that they're tweaking. And what we're trying to differentiate is whether it affects the font or the color (or both).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@j4james I appreciate that! Thanks. We're gonna merge this as is to get the feature into selfhost/test builds and work on the wording from there. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(we're gonna work on the wording in post)
@@ -11,6 +11,8 @@ namespace Microsoft.Terminal.Control | |||
Windows.UI.Xaml.Media.Stretch BackgroundImageStretchMode; | |||
Windows.UI.Xaml.HorizontalAlignment BackgroundImageHorizontalAlignment; | |||
Windows.UI.Xaml.VerticalAlignment BackgroundImageVerticalAlignment; | |||
Boolean IntenseIsBold; | |||
// IntenseIsBright is in Core Appearance |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
technically both should be there, since eventually we'll push down the renderer right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO eventually is not today, and I'd rather be self-consistent with the state of the world and not what we expect the world to be (which may lead to confusion)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
…10759) This adds a new setting `intenseTextStyle`. It's a per-appearance, control setting, defaulting to `"all"`. * When set to `"all"` or `["bold", "bright"]`, then we'll render text as both **bold** and bright (1.10 behavior) * When set to `"bold"`, `["bold"]`, we'll render text formatted with `^[[1m` as **bold**, but not bright * When set to `"bright"`, `["bright"]`, we'll render text formatted with `^[[1m` as bright, but not bold. This is the pre 1.10 behavior * When set to `"none"`, we won't do anything special for it at all. * I last did this in #10648. This time it's an enum, so we can add bright in the future. It's got positive wording this time. * ~We will want to add `"bright"` as a value in the future, to disable the auto intense->bright conversion.~ I just did that now. * #5682 is related * [x] Closes #10576 * [x] I seriously don't think we have an issue for "disable intense is bright", but I'm not crazy, people wanted that, right? #2916 (comment) was the closest * [x] I work here * [x] Tests added/passed * [x] MicrosoftDocs/terminal#381 <!-- ![image](https://user-images.githubusercontent.com/18356694/125480327-07f6b711-6bca-4c1b-9a76-75fc978c702d.png) --> ![image](https://user-images.githubusercontent.com/18356694/128929228-504933ee-cf50-43a2-9982-55110ba39191.png) Yea that works. Printed some bold text, toggled it on, the text was no longer bold. hooray. ```json "intenseTextStyle": "none", "intenseTextStyle": "bold", "intenseTextStyle": "bright", "intenseTextStyle": "all", "intenseTextStyle": ["bold", "bright"], ``` all work now. Repro script: ```sh printf "\e[1m[bold]\e[m[normal]\e[34m[blue]\e[1m[bold blue]\e[m\n" ```
🎉 Handy links: |
🎉 Handy links: |
Summary of the Pull Request
This adds a new setting
intenseTextStyle
. It's a per-appearance, control setting, defaulting to"all"
."all"
or["bold", "bright"]
, then we'll render text as both bold and bright (1.10 behavior)"bold"
,["bold"]
, we'll render text formatted with^[[1m
as bold, but not bright"bright"
,["bright"]
, we'll render text formatted with^[[1m
as bright, but not bold. This is the pre 1.10 behavior"none"
, we won't do anything special for it at all.references
We will want to addI just did that now."bright"
as a value in the future, to disable the auto intense->bright conversion.PR Checklist
Validation Steps Performed
Yea that works. Printed some bold text, toggled it on, the text was no longer bold. hooray.
EDIT, 10 Aug
all work now. Repro script: