Skip to content

Commit b3f0afb

Browse files
j4jamesDHowett
authored andcommitted
Make sure a blank title string resets the title (#17802)
## Summary of the Pull Request When a VT title sequence sets the title to a blank string, that is meant to trigger a reset to the default starting value. This used to work in the past because the blank value was dealt with by conhost, so Windows Terminal never received a blank title, but that's no longer the case with the new VT passthrough. This PR fixes the issue by getting Windows Terminal to handle the blank title strings itself. ## References and Relevant Issues VT passthrough was introduced in PR #17510. ## Validation Steps Performed I've manually verified that the `OSC 0`, `OSC 2`, and `DECSWT` sequences now correctly reset the title when passed a blank title string. ## PR Checklist - [x] Closes #17800 (cherry picked from commit 1f71568) Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgSNvr0 PVTI_lADOAF3p4s4AmhmQzgSOFrc Service-Version: 1.22
1 parent 90cfb33 commit b3f0afb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/cascadia/TerminalCore/TerminalApi.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ void Terminal::SetWindowTitle(const std::wstring_view title)
8686
_assertLocked();
8787
if (!_suppressApplicationTitle)
8888
{
89-
_title.emplace(title);
89+
_title.emplace(title.empty() ? _startingTitle : title);
9090
_pfnTitleChanged(_title.value());
9191
}
9292
}

0 commit comments

Comments
 (0)