Fedora has patched gnome-terminal to present a desktop notification when a command has completed. When I used JHBuild, I always received a notification immediately after my build succeeded or failed, so I could take appropriate action. I relied on this for productivity.
With BuildStream, there is no notification when the build fails. (I think there is a notification when it succeeds.) I'm absentminded and find that I often do not notice a build has failed until much later, sometimes hours later. Since BuildStream presents its own failure prompt to allow the user to choose what action to take, perhaps BuildStream should manually create notifications. But there's a difficultly here: notifying would be undesirable if BuildStream is running in a currently-focused terminal. So maybe integration with gnome-terminal, and investigation of how exactly the terminal notifications work, will be required. Debarshi Ray is the expert on this.
There shalt be no terminal, desktop, or even OS specific code being added directly BuildStream - yes that means even with an if clause.
An option for this which, which I had discussed with @TheRealMichaelCatanzaro on irc but failed to update / close this issue, is to have this done with a user specific event hook after implementing #188.
A different option would be to implement some concept of extensions or platform specific frondends, but we are not going to start adding if statements for special features in the core, that wont happen.
Instead of WONTFIX'ing this issue, I feel it's more appropriate to leave it open until #188 is fixed in such a way which allows addressing this.
There shalt be no terminal, desktop, or even OS specific code being added directly BuildStream - yes that means even with an if clause.
I think it's very important to find some solution to this, because I'm losing hours. It's nice to avoid hacks when possible, but please consider this a critical issue.
I don't run fedora so I don't really have an easy way to test this notification.
Another point, is that apparently this is only implemented when there is a failed build and a prompt appears; I think it would probably make sense to issue a frontend notification at the end of a build.
@TheRealMichaelCatanzaro, does the code appear to be doing the right things to you ? and maybe did you expect a notification at end of build which didn't happen ?
@TheRealMichaelCatanzaro, does the code appear to be doing the right things to you ? and maybe did you expect a notification at end of build which didn't happen ?
I've never seen a notification at the end of a BuildStream build.
Certainly, I want a notification whether the build succeeded or failed.
It would be useful to always get a notification when the terminal tab is not focused (including not on the current workspace... but I don't think it's even possible for a Wayland client to know what workspace it is on!)... that does pretty much require integration with the terminal, which is sadly only available in Fedora right now.
The next best thing would be for BuildStream to unconditionally emit the notification when the build finishes. That might be annoying as I don't need the notification if the build finishes when I'm watching the terminal, but seems like that's the best we can do if it's to be available on all distros. It could be turned off via a config file for developers who don't like it.
I've never seen a notification at the end of a BuildStream build.
Well, let me rephrase that: I don't remember ever seeing a notification at the end of a BuildStream build. I reserve the right to be misremembering here. ;)
Only the cases where there is no notification are memorable, because they are frustrating.
@TheRealMichaelCatanzaro: So this should really be fixed now in both master and bst-1.2 (users should be on bst-1.2 for a while, I cannot recommend testing master for a while, we are working on making this story more clear presently).
For this issue, we still lack CI which allows testing the interactive parts of BuildStream, but I have:
Downloaded a Fedora 28 VM
Verified that the magick OSC 777 escape code does indeed work in a default terminal in recent Fedora
Note that there is a little bit of wonkiness, at the end of a session; we now trigger the notification of success or failure, in addition to notifying the user when a build fails and there is an interactive prompt.
This is only "wonky" because Fedora, in addition to supporting the OSC 777 in vte which was rejected upstream; also notifies the user when any terminal command completes with the window out of focus. The result appears to be just that the second; hard coded notification in Fedora just overwrites the one we attempt to issue with the OSC 777 escape sequence.
This appears to me to be the right thing; we should make an attempt to notify that the session completed, and if a desktop has additional hard coded notifications; that should not be our concern.
Further, after finding that OSC 777 issues garbage on my terminal; I have made it currently only enabled where:
The terminal uses VTE
The VTE_VERSION >= 4600. This is because we know that a version of VTE that is >= 4600 will at least safely swallow and ignore the non standard escape sequence, so garbage cannot end up on your terminal. For versions of Fedora or other desktops which patch VTE >= 4600 to enable the feature, this will "just work".
It is possible to enable the notification in other terminals, but I consider that separate activities of research and testing.