-
-
Notifications
You must be signed in to change notification settings - Fork 312
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Desktop notifications (OSC 9/99/777) #499
Comments
Note that foot supports OSC-9 as well (in addition to 777, as already mentioned above). |
Updated |
It sure would be nice if these various terminals -- many of which simply leverage xterm-256color or something -- could come up with some common standards. It's hard to keep up with all the various local escape sequences that each terminal either does or does not support. |
So I think the biggest consensus is with OSC 777. Windows Terminal plans on supporting it at some point just based on sheer fact that more terminals support it than the other niche OSC sequences for the same result. Also ConEmu is incompatible with OSC9 due to re-using it for another purpose. So the trend really is "stick with OSC 777 for desktop notifications". See microsoft/terminal#7718 (comment) |
I'll probably do this as an OSC 777... Hopefully there won't be surprises for other terminals. It's easier to be generous on the input, but I would prefer to be more cautious when emitting things that are not standardized in case it breaks someone terminal. |
Note that iTerm puts LC_TERMINAL into its environment. I have mixed feelings about this -- one the one hand it's very helpful since it discriminates iTerm from the rest. But on the other hand, the "right" solution is IMO to define a $TERM properly and not keep relying on xterm-256color. But I also understand the pragmatic reasons that they have done this -- it's hard to get everyone to update their terminfo/termcap databases.... |
Given that, if more of these xterm256-colors "pretenders" would use the LC_TERMINAL hack to identify the specific flavor, I'd find it very helpful. |
Is there a way to dynamically know about OSC 777 support by looking at the dynamic/on-disk terminfo? |
This considers OSC 777 is supported (or at least correctly dropped) when the terminal supports Ms (usually OSC 52). See: gdamore#499
This feature would probably be better in a separate library like: https://github.com/martinlindhe/notify. Then it doesn't depend on the capabilities of the terminal at all. |
On Tue, 15 Aug 2023, at 09:58, bjorndm wrote:
This feature would probably be better in a separate library like: https://github.com/martinlindhe/notify. Then it doesn't depend on the capabilities of the terminal at all.
What you’re suggesting shows a notification on the host where the application is running. The approach in this issue shows a notification on the host where the terminal is running.
These may be different hosts (eg: when running an application over ssh).
|
That's true, I didn't consider the remote case. Sorry for missing the point. |
For the record, ConEMU is so bad right now that I cannot use it in vte mode. I don't recommend it. I'm not going to implement any improvements for ConEmu until they fix their bug with automargin wrapping causing the colors (but not the text!) to scroll when updating the last cell in the terminal. I will consider the rest of these -- I have made some significant enhancements to tcell lately and these might fall in scope. |
Well, experimentally I'm finding this really not very useful on pretty much any of the terminal emulators I use the most. |
Hi!
I would like to add support for desktop notifications to tcell and allow applications to trigger notifications via the terminal.
Motivation
Would be nice to lift off the keyboard focus logic from the application/end user to the terminal (i.e. let the terminal not send the notification if it has focus).
Specs and implementations
There are several OSC for this (of course..) and each terminal implement the one it wants..
OSC 9
ITerm Growl notifications
Implementors: ITerm (need ref), kitty, foot
libvte swallows the escape
NB: it conflicts with ConEmu's specific OSC but it shouldn't be a problem for tcell
OSC 99
Comes from terminal-wg but since they wouldn't decide kitty went and implemented its thing.
Implementors: kitty
OSC 777
Comes from this little urxvt perl extension (yes), more context in this article.
Implementors: urxvt (with the notify extension), foot, contour
libvte swallows the escape
Users
These OSCs are already exploited in the wild:
Design proposal
This depends on a ((hopefully) upcoming) refactor of
TParm
to allow string parameters in escapes:#468 (comment)
Add a member in
terminfo
, e.g.:and two methods to
Screen
:The text was updated successfully, but these errors were encountered: