Skip to content

Add support for OSC777 (Send Notification)#20012

Open
carlos-zamora wants to merge 4 commits intodev/cazamor/toast/basefrom
dev/cazamor/toast/osc777
Open

Add support for OSC777 (Send Notification)#20012
carlos-zamora wants to merge 4 commits intodev/cazamor/toast/basefrom
dev/cazamor/toast/osc777

Conversation

@carlos-zamora
Copy link
Member

Summary of the Pull Request

targets #20010

This adds support for the OSC 777 ; notify ; title ; body ST sequence. This allows client applications to send a notification to the Terminal. When this notification is clicked, it summons the terminal window that sent it.

Validation Steps Performed

# in PowerShell. Terminal should not be focused.
sleep 2; Write-Output "`e]777;notify;Hello;This is a notification`a"

PR Checklist

Heavily based on #19938
Co-authored by @zadjii-msft

const auto title = parts.size() >= 2 ? til::at(parts, 1) : std::wstring_view{};
const auto body = parts.size() >= 3 ? til::at(parts, 2) : std::wstring_view{};
_api.ShowNotification(title, body);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After #20009 merged yesterday, I think this now needs an:

else
{
    _api.UnknownSequence();
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. I never would've caught this haha

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need another one of those here?

if (!_optionalFeatures.test(OptionalFeature::DesktopNotification))
{
return;
}

{
_dispatch->DoDesktopNotification(string);
break;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, you can drop those braces here.

@carlos-zamora carlos-zamora force-pushed the dev/cazamor/toast/base branch from 4357c17 to aeb531f Compare March 25, 2026 17:29
@carlos-zamora carlos-zamora force-pushed the dev/cazamor/toast/osc777 branch from 2f5763e to 34b985d Compare March 25, 2026 17:51
@github-actions

This comment has been minimized.

@carlos-zamora carlos-zamora force-pushed the dev/cazamor/toast/osc777 branch from 34b985d to 7ea4f2f Compare March 25, 2026 21:49
@github-actions

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants