Know when Terminal.app is done working.
Shell
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Readme.md
ready_milord.sh

Readme.md

ready_milord

Do you often start a long-running command like an import or test suite, switch app to do something else, and promptly forget about the command? I do. This helps me unforget.

This is a shell function for the OS X Terminal that sits in your prompt. It uses AppleScript to check if the Terminal is in the background when the prompt is printed and notifies you with Growl.

Requirements

You must have Growl and growlnotify installed.

Install

Download ready_milord.sh and put source ready_milord.sh somewhere after your prompt definition (PS1) in your .bashrc or equivalent.

Here's the relevant bit from my .bashrc as an example:

PS1='\[\033[0;36m\].----[\
\[\033[0;32m\] \u@\[\033[7m\]\h\[\033[0m\]\
\[\033[0;36m\] ]----[\
\[\033[0;32m\] \w\
\[\033[0;36m\] ]\
$(__git_ps1 "\[\033[0;36m\]----[ \[\033[0;32m\]%s\[\033[0;36m\] ]")\
\n\
\[\033[0;36m\]‛-- $\
\[\033[0m\] '

source ~/.ready_milord.sh

Downside

Sometimes the AppleScript takes a long time to run and so blocks execution for a second or two. It can be a bit annoying, but you learn to live with it.

License

Baconright 2012 Kim Ahlström, kim.ahlstrom@gmail.com