mirror of
https://github.com/microsoft/terminal.git
synced 2026-05-18 18:56:25 +00:00
fix announcement for duplicate tab/pane
This commit is contained in:
@@ -747,9 +747,11 @@
|
||||
<comment>{0} will be replaced with a number.</comment>
|
||||
</data>
|
||||
<data name="NewTabAnnouncement" xml:space="preserve">
|
||||
<value>{} profile tab created successfully</value>
|
||||
<value>A new tab for the "{}" profile was created successfully</value>
|
||||
<comment>{} will be replaced with the name of the profile (i.e. PowerShell, Command Prompt, etc.). The name may span multiple words. This announcement is read by a screen reader.</comment>
|
||||
</data>
|
||||
<data name="SplitPaneAnnouncement" xml:space="preserve">
|
||||
<value>{} profile pane created successfully</value>
|
||||
<value>A new pane for the "{}" profile was created successfully</value>
|
||||
<comment>{} will be replaced with the name of the profile (i.e. PowerShell, Command Prompt, etc.). The name may span multiple words. This announcement is read by a screen reader.</comment>
|
||||
</data>
|
||||
</root>
|
||||
@@ -87,15 +87,6 @@ namespace winrt::TerminalApp::implementation
|
||||
// case above with the _maybeElevate call.
|
||||
_CreateNewTabFromPane(_MakePane(newTerminalArgs, false, existingConnection));
|
||||
|
||||
if (_autoPeer)
|
||||
{
|
||||
_autoPeer.RaiseNotificationEvent(
|
||||
Automation::Peers::AutomationNotificationKind::ActionCompleted,
|
||||
Automation::Peers::AutomationNotificationProcessing::ImportantMostRecent,
|
||||
fmt::format(std::wstring_view{ RS_(L"NewTabAnnouncement") }, settings.DefaultSettings().ProfileName()),
|
||||
L"NewTab" /* unique name for this notification category */);
|
||||
}
|
||||
|
||||
const auto tabCount = _tabs.Size();
|
||||
const auto usedManualProfile = (newTerminalArgs != nullptr) &&
|
||||
(newTerminalArgs.ProfileIndex() != nullptr ||
|
||||
@@ -297,6 +288,20 @@ namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
auto newTabImpl = winrt::make_self<TerminalTab>(pane);
|
||||
_InitializeTab(newTabImpl);
|
||||
|
||||
if (_autoPeer)
|
||||
{
|
||||
// we can't check if this is a leaf pane,
|
||||
// but getting the profile returns null if we aren't, so that works!
|
||||
if (const auto profile{ pane->GetProfile() })
|
||||
{
|
||||
_autoPeer.RaiseNotificationEvent(
|
||||
Automation::Peers::AutomationNotificationKind::ActionCompleted,
|
||||
Automation::Peers::AutomationNotificationProcessing::ImportantMostRecent,
|
||||
fmt::format(std::wstring_view{ RS_(L"NewTabAnnouncement") }, profile.Name()),
|
||||
L"NewTab" /* unique name for this notification category */);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user