Skip to content

Commit

Permalink
suppressApplicationTitle suppresses initial application title (micros…
Browse files Browse the repository at this point in the history
…oft#3837)

Fixed bug where suppressApplicationTitle didn't suppress initial title from application
Also fixes the Azure Cloud Shell issue.
  • Loading branch information
cinnamon-msft authored and carlos-zamora committed Dec 4, 2019
1 parent 5c43f05 commit 54966c3
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 54966c3

Please sign in to comment.