Add support for OSC777 - send notification#14425
Conversation
| <toast>\ | ||
| <visual>\ | ||
| <binding template=\"ToastGeneric\">\ | ||
| <text></text>\ | ||
| <text></text>\ | ||
| </binding>\ | ||
| </visual>\ | ||
| </toast>" }; |
There was a problem hiding this comment.
Lemme tell you, it's a disaster. At least the sample has like, 25% c++winrt code these days. The original sample was "Well, the API it hard to use, so go get this third party nuget package, and do some C#" 🤦
|
Is there going to be an optional WinToast notification as well users can set in settings.json or Settings UI (Similar to BEL where we could have visual, audio or both) where here we have "only within the Terminal, only in the Action Center or both"?) |
I'd reckon probably not. Toasts have been harder to do right in the Terminal than it's been worth (see #8592). |
|
The issue you linked sounds a bit different than the guide I provided within 7718 (which this PR would close) but maybe they're the same thing. |
|
@WSLUser You linked to https://learn.microsoft.com/en-us/windows/apps/design/shell/tiles-and-notifications/scheduled-toast in #7718, which looks like a guide around using a C# wrapper around the same toast notification APIs I'm using here. Windows apparently just calls all these notifications "toast notifications", which kinda muddies the water when comparing to something like Android (where Toasts and Notifications are two very different concepts). |
Oh hey, this is a problem. We might have to disable this entirely for elevated instances. The notification is obviously running unelevated. When it calls back to our app, you guessed it, it calls into the unelevated instance. We can't trivially have a notification call back to an elevated instance. We'd need to have the unelevated |
…7718-notifications-reboot
…otifications-reboot
|
Note to self - pushed a merge of this with main to |
…otifications-reboot
This reverts commit 4ab628d.
…m/microsoft/terminal into dev/migrie/fhl/7718-notifications
This comment has been minimized.
This comment has been minimized.
|
Further notes from 4ab628d:
Does this just... not work ever? |
|
At this point, I'm very tempted to stick this behind velocity and only enable for Dev & Canary builds, while we sort out the foreground issues |
|
I'm very on the fence about this, even checked in behind velocity.
Frankly, I still don't see the value in offering this support! 😄 |
fite-me.emoji |
|
we can come back to this if we ever want it |
|
(there's more discussion over at #20012, but this is just the start of working on it, we'd be open to more feature requests and contributions once that merges 😉) |

This adds support for the
OSC 777 ; notify ; title ; body STsequence. This allows client applications to send a notification to the Terminal. When this notification is clicked, it summons the terminal window that sent it.This can be used in PowerShell as follows:
other details
windowsterminal.exe. So we've got to be able to send a notification to the existing window, WITHOUT registering as the monarch. That's whatWindowManager::SummonForNotificationis all about.todo