-
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
Initialize the foreground and background in TermControl's constructor #9792
Conversation
// (they will also be called later in UpdateAppearance, but we want to have it here so | ||
// that the terminal is not gray on startup) | ||
const auto bg = _settings.DefaultBackground(); | ||
_BackgroundColorChanged(bg); |
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 actually.. afraid of this. BackgroundColorChanged is also a fire_and_forget which we should not use from the constructor (!)
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.
Ah, thanks for pointing that out. Fixed it here and in _UpdateAppearanceFromUIThreadUnderLock
@@ -198,8 +198,16 @@ namespace winrt::Microsoft::Terminal::Control::implementation | |||
// Set the foreground and background here in the constructor | |||
// (they will also be called later in UpdateAppearance, but we want to have it here so | |||
// that the terminal is not gray on startup) | |||
const auto bg = _settings.DefaultBackground(); | |||
_BackgroundColorChanged(bg); | |||
til::color newBgColor{ _settings.DefaultBackground() }; |
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 suspect you know what i am going to say about us having three copies of this code ;P
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.
ahh haha alright that's fair... I was just trying to have it so there's only 1 update appearance call but okay will make a helper for the fg/bg
We're going to ship w/the gray flash. I'll keep this marked for Servicing. |
Wow, this is still relevant @zadjii-msft with your split? |
I cannot repro the 'starting up gray' issue so I'm closing this! |
We recently moved setting the foreground and background out of
TermControl::_ApplyUISettings
, but that means we no longer set theforeground/background in the constructor, resulting in the terminal
being gray on startup until we call
UpdateAppearance
after therenderer is setup. This change sets the foreground and background in the
TermControl constructor to avoid this.
Validation Steps Performed
Terminal no longer starts up gray