Skip to content

Commit

Permalink
suppressApplicationTitle suppresses initial application title (#3837)
Browse files Browse the repository at this point in the history
Fixed bug where suppressApplicationTitle didn't suppress initial title from application
Also fixes the Azure Cloud Shell issue.

(cherry picked from commit 54966c3)
  • Loading branch information
cinnamon-msft authored and DHowett committed Dec 11, 2019
1 parent 4411ce5 commit 565b9b4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 18 deletions.
5 changes: 5 additions & 0 deletions src/cascadia/TerminalCore/Terminal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ void Terminal::CreateFromSettings(winrt::Microsoft::Terminal::Settings::ICoreSet
{
const COORD viewportSize{ Utils::ClampToShortMax(settings.InitialCols(), 1),
Utils::ClampToShortMax(settings.InitialRows(), 1) };

if (_suppressApplicationTitle)
{
_title = _startingTitle;
}
// TODO:MSFT:20642297 - Support infinite scrollback here, if HistorySize is -1
Create(viewportSize, Utils::ClampToShortMax(settings.HistorySize(), 0), renderTarget);

Expand Down
20 changes: 2 additions & 18 deletions src/cascadia/TerminalCore/TerminalApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -365,25 +365,9 @@ bool Terminal::EraseInDisplay(const DispatchTypes::EraseType eraseType)

bool Terminal::SetWindowTitle(std::wstring_view title)
{
// Set the title on Terminal load
if (_title.empty())
{
_title = title;
_pfnTitleChanged(title);
}

_title = title;

// If this is removed, the tab object assumes the application title is the title
if (_suppressApplicationTitle)
{
_title = _startingTitle;
}
_title = _suppressApplicationTitle ? _startingTitle : title;

if (_pfnTitleChanged && !_suppressApplicationTitle)
{
_pfnTitleChanged(_title);
}
_pfnTitleChanged(_title);

return true;
}
Expand Down

0 comments on commit 565b9b4

Please sign in to comment.