I want to build a notification with info about the current command using terminal-notifier
but I fail to find the way to get the current command, marked as (????)
below.
alias notify=terminal-notifier -message "Done with [(????)]" -title (if test $status = 0; echo "$_ suceeded"; else; echo "$_ exited with error [$status]"; end) -sound default -ignoreDnD
Where I'd use it as echo 1; notify
and the message would be Done with [echo 1;notify]
I have tried $_
, status current-command
and commandline
but neither include the parameters or what's after the pipe. history | head -n1
doesn't have the command until after it's executed.