-
Notifications
You must be signed in to change notification settings - Fork 32k
Provide "terminal.integrated.enableBold" setting connected to #22422 #22465
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
Conversation
@lifez, thanks for your PR! By analyzing the history of the files in this pull request, we identified @alexandrudima and @Tyriar to be potential reviewers. |
@lifez, It will cover your contributions to all Microsoft-managed open source projects. |
@lifez, thanks for signing the contribution license agreement. We will now validate the agreement and then the pull request. |
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.
Thanks @lifez, made some comments.
@@ -105,6 +105,11 @@ configurationRegistry.registerConfiguration({ | |||
'type': 'number', | |||
'default': 1.2 | |||
}, | |||
'terminal.integrated.fontWeight': { | |||
'type': 'string', | |||
'description': nls.localize('terminal.integrated.fontWeight', "Customizes font weight in terminal."), |
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.
This needs to be something like enableBold
like how gnome-terminal does it, otherwise this setting will override the terminal's regular bold/normal formatting with what's in this setting.
The logic should then be added as an event listener on the IConfigurationService
so it's picked up when the setting is changed, something like this:
set class name 'disable-bold' if `enableBold` setting is not set
I use disable-bold
as the class name here because enableBold will be the standard.
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.
You mean set terminal.integrated.enableBold
to false
Then add class disable-bold
to provide font-weight: normal;
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.
Yes
@@ -96,7 +96,7 @@ export class TerminalConfigHelper implements ITerminalConfigHelper { | |||
return DEFAULT_ANSI_COLORS[baseThemeId]; | |||
} | |||
|
|||
private _measureFont(fontFamily: string, fontSize: number, lineHeight: number): ITerminalFont { | |||
private _measureFont(fontFamily: string, fontSize: number, lineHeight: number, fontWeight: string): ITerminalFont { |
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.
It's fine to leave out font weight from font measurement as the terminal assumes we're working with a monospace font where bold size is the same as non-bold size.
I have rethink about it.It would be great if we can set The reason is when I use vscode on osx with the integrate terminal text is not bold What do you think? @Tyriar |
So you want all bold text? I wonder if you can set the font family to the be the bold variant? Ie. font-family: "Courier New Bold" or something? |
Oh, ok I miss this point :) |
Could you guide me a little about event listener on |
@lifez sure, you will want to listen to the Then you will want to add the styles to |
@lifez I tried to resolve the conflicts using GitHub's web UI for the first time to help you out, hopefully I didn't break compilation or anything 😄 |
@Tyriar Thank you Then i will do something like this |
@lifez yes, but prefer the explicit value instead of toggle: DOM.toggleClass(this._parentDomElement, 'disable-bold', !isEnabled); |
Thanks @lifez, I tweaked things a bit and this is good to go 👍 |
Fixes #22422