[Quick and Dirty] Copy runtime tab title when duplicating tabs (#9813)
## PR Checklist * [x] Closes https://github.com/microsoft/terminal/issues/9723 * [x] CLA signed. * [ ] Tests added/passed * [ ] Documentation updated. * [ ] Schema updated. * [ ] I've discussed this with core contributors already. ## Detailed Description of the Pull Request / Additional comments Quick and dirty. A better solution is to allow passing all "runtime settings" upon tab creation.
This commit is contained in:
parent
ad34291632
commit
ad625a041d
|
@ -323,6 +323,15 @@ namespace winrt::TerminalApp::implementation
|
|||
}
|
||||
|
||||
_CreateNewTabFromSettings(profileGuid.value(), settingsCreateResult);
|
||||
|
||||
const auto runtimeTabText{ tab.GetTabText() };
|
||||
if (!runtimeTabText.empty())
|
||||
{
|
||||
if (auto newTab{ _GetFocusedTabImpl() })
|
||||
{
|
||||
newTab->SetTabText(runtimeTabText);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
CATCH_LOG();
|
||||
|
|
|
@ -510,6 +510,11 @@ namespace winrt::TerminalApp::implementation
|
|||
UpdateTitle();
|
||||
}
|
||||
|
||||
winrt::hstring TerminalTab::GetTabText() const
|
||||
{
|
||||
return _runtimeTabText;
|
||||
}
|
||||
|
||||
void TerminalTab::ResetTabText()
|
||||
{
|
||||
_runtimeTabText = L"";
|
||||
|
|
|
@ -61,6 +61,7 @@ namespace winrt::TerminalApp::implementation
|
|||
void ClosePane();
|
||||
|
||||
void SetTabText(winrt::hstring title);
|
||||
winrt::hstring GetTabText() const;
|
||||
void ResetTabText();
|
||||
void ActivateTabRenamer();
|
||||
|
||||
|
|
Loading…
Reference in a new issue