-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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 suppressApplicationTitle as boolean #2814
Conversation
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.
A few questions 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. |
hi @cinnamon-msft @zadjii-msft do we have any update on it? i really need this feature for WSL. |
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. |
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.
Couple questions here - I really don't think that we need startingTitle
down in the Terminal
core, but I could be wrong
_title = title; | ||
|
||
if (_suppressApplicationTitle) |
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.
Couldn't we just not call _pfnTitleChanged
when _suppressApplicationTitle
is true? That would negate the need to the Terminal
core to know about startingTitle, it would just not send title change events at all.
Maybe the _pfnTitleChanged
needs to be called on the first time through this method, but not on subsequent calls...
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.
If we don't call _pfnTitleChanged
when _suppressApplicationTitle
is true, refocusing on the tab/pane within the tab (term.GotFocus()
in TerminalPage.cpp) will call that tab's stored title, which is stored as the application title.
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 seems like we could just set _title
to StartingTitle
as early as possible (when we apply the settings), and then we never have to make the check here on 368-373. Then, we can just simplify the code in here to:
if (!_suppressApplicationTitle)
{
_title = title;
if (_pfnTitleChanged)
{
_pfnTitleChanged(_title)
}
}
return true;
and that's it. We never update _title
, we never check if it's empty (settings always sets it), we don't have to store _startingTitle
separately 😄
@@ -162,12 +162,14 @@ class Microsoft::Terminal::Core::Terminal final : | |||
std::unique_ptr<::Microsoft::Console::VirtualTerminal::TerminalInput> _terminalInput; | |||
|
|||
std::wstring _title; | |||
std::wstring_view _startingTitle; |
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 mildly concerned about storing this as a wstring_view
. Won't this explode when the method that sets this goes out of scope, as the backing wstring
gets freed?
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.
Minor nits. Not worth blocking.
@@ -93,6 +94,7 @@ Profile::Profile(const std::optional<GUID>& guid) : | |||
_selectionBackground{}, | |||
_colorTable{}, | |||
_tabTitle{}, | |||
_suppressApplicationTitle{}, |
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.
_suppressApplicationTitle{}, | |
_suppressApplicationTitle{ false }, |
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.
Isn't this only if it's set false as default?
_title = title; | ||
|
||
if (_suppressApplicationTitle) |
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 seems like we could just set _title
to StartingTitle
as early as possible (when we apply the settings), and then we never have to make the check here on 368-373. Then, we can just simplify the code in here to:
if (!_suppressApplicationTitle)
{
_title = title;
if (_pfnTitleChanged)
{
_pfnTitleChanged(_title)
}
}
return true;
and that's it. We never update _title
, we never check if it's empty (settings always sets it), we don't have to store _startingTitle
separately 😄
5d96c7a
to
5badf2c
Compare
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 concur with the one outstanding comment from Mike and Dustin and would like to see the resolution before I sign.
My comment no longer applies, and we reverted the code that make it happen because it was actually worse |
I'm dismissing myself so I no longer block - I'm thoroughly confused about the state of this re: Dustin's comments, so I'm handing off to him
🎉 Handy links: |
Summary of the Pull Request
Add suppressApplicationTitle as a setting
References
PR Checklist
Detailed Description of the Pull Request / Additional comments
Validation Steps Performed
If there's no
tabTitle
,suppressApplicationTitle
does nothingIf
suppressApplicationTitle
is set to false,tabTitle
acts as normalIf they both exist,
tabTitle
persists as the tab title