Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Would like an alias to read the part of the current command line that precedes the alias



On Thu, Oct 13, 2011 at 3:32 PM, Bart Schaefer
<schaefer@xxxxxxxxxxxxxxxx> wrote:

>    typeset -g _LASTALERT=$HISTCMD
>    preexec() {
>      SECONDS=0
>    }
>    precmd() {
>      local alert="${${?/0/Terminal}//<->*/Problem Reporter}"
>      (( _LASTALERT < HISTCMD && SECONDS > 1 )) &&
>        growlnotify -p "Very Low" -a "$alert" -m "$history[$_LASTALERT]"
>      _LASTALERT=$HISTCMD
>    }

looks great, thanks!
-- 
Aaron Davies
aaron.davies@xxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author