Skip to content

Monitor session for process to complete

Will Westrop requested to merge wwestrop/konsole:monitor-process-finished into master

Summary

Implements feature request 420053 -> alert me when a long-running process completes

Konsole already has options to "Monitor for Silence" and "Monitor for Activity" on the View menu

Say I have a long-running script, which is sometimes spammy, and sometimes silent for a long time (eg downloading lots of data). In this case, I'd like to just put it into the background, and have Konsole ping me when the whole thing is done.

Because of the script's sometimes-quiet-sometimes-not nature, both of the existing options will give me multiple spurious notifications before the script has finished entirely.

UI changes

Adds this option to the menu: menu

Adds these options to the notification configuration: notification-setup

Adds this notification when the above are set correctly: notification-toast-2

Caveats

  • This code works by detecting when the process running in a session reverts back to the one it initially started with. If you start another shell and then run a script from there, you will not get a notification (the dialog when closing a tab/window has similar behaviour)
  • I added this notification in SessionController (the existing ones were in Session). I've done this as I'm re-using the same place that updates the tab title when the process changes (it polls on a timer)
    • This also means it doesn't emit the signals from Session like activity/silence do. The signals affect the icon shown on the tab. (I see recently there have been changes around how tab icons show notifications/bell. Perhaps this ought to be extended to do similar?)

FEATURE: 420053

Edited by Nate Graham

Merge request reports