in iterm bash notification noti tip ~ read.

Get Notified when your command in Terminal has finished

Currently i'm working a lot on serverless projects and deploying a new service that has multiple lambda's or event a step function can be time consuming. In this case it was quite often for me to "forget" about the running deploy in the Terminal and get distracted by something else. Checking from time to time the progress is also not fun, so i started to think on how can i get notified about my script finish. After some investigation i found 2 solutions :

iTerm Users

If you have iTerm ( if not, then i would recommend you to start using it)
Here's what you can do :

  1. Open iTerm
  2. Click on iTerm -> Install Shell Integration
  3. After everything is done, before or while running your long running script (hello brew update or sls deploy) press ⌥⌘ + A combination (option + command + A).
  4. Now you can put your terminal in background and check something else. When your script will finish, you will get a notification from iTerm

Terminal Users

Now, if you, for some reason, don't like iTerm and using something else (like Intellij products terminal), then you can install noti - small script that will also notify your on command execution result.
Here's what you need to do :

  1. brew install noti
  2. Run noti brew update
  3. Put your terminal away and noti will let you know when your command is done.

Both approaches requiers some additional actions to do in order to get notifications - in case of iTerm you will have to press ⌥⌘ + A everytime you want to "watch" command progress, and with noti you will have to put noti in front of your command.

Personally i think i will stick with iTerm feature for now, as pressing key combination is not hard and i don't have to modify my cli commands in order to get notified.

Big thanks to Paschalis for his answer in this Stackoverflow post

comments powered by Disqus
comments powered by Disqus