Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: command completion notification
- X-seq: zsh-users 17194
- From: William Scott <wgscott@xxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: command completion notification
- Date: Sat, 4 Aug 2012 20:43:18 -0700
- Cc: zsh-users@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ucsc.edu; s=ucsc-google; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=s23rSlBxt0IAIue94BWwaAh2VA+fZase7NJrV8ndLfQ=; b=P5iCXNGbNliVcI9kcP4tAEVRaP3PoTm1EbffkbcMX2GRsVB4RH9Q20L1fGtacNnMrt /o6OcfVr2O6hlVE3NI4S7FMNj4MpTlbpmwyvCXnL3fKlJR9n3rehodI6y1hGc3opq8g0 8lP2mh3sQWWX7YzBWJYRGv/pdoIjyGQXJFgFY=
- In-reply-to: <120804161046.ZM14799@torch.brasslantern.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <61BB4B35-A02F-44F8-B793-A7F90543D25F@ucsc.edu> <120804161046.ZM14799@torch.brasslantern.com>
Dear Bart:
Thanks for writing back. and for your advice.
On Aug 4, 2012, at 4:10 PM, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> There was a thread from last October about using growl for this same
> sort of thing. See http://www.zsh.org/mla/users/2011/msg00798.html
> and surrounding conversation.
The site is down, but I will take a look when I can. I was in fact using growl,
but never got beyond this. I wound up aliasing a few commands to run growl-notify.
I wouldn't mind a general solution, as growl probably isn't going to disappear.
>
>
> There are two issues here:
>
> (1) Your terminal emulator (I presume just the MacOS terminal app) must
> send a recognizable different character or key sequence when you press
> control-return -- I'm not in front of my Mac so can't test that now.
>
> (2) It depends on what you want the binding to do. For example, to
> simply insert "tnot" in front of the current command and then run it:
>
> tnot-widget() { BUFFER="tnot $BUFFER"; zle accept-line }
> zle -N tnot-widget
>
> and then bindkey for whatever character is sent by control-return, to
> the tnot-widget.
>
> I expect you're going to have more trouble with (1).
You suspected correctly. (2) worked like a charm, and am embarrassed since I read that chapter in your book last night.
I'm still trying to figure out how to do (1) in some reasonably elegant manner. I'm using iTerm, since it is a bit more amenable to zsh scripting control than terminal, and it in fact has a built-in growl notification, but it is overkill, so I wind up turning it off.
Maybe I am taking a stupid approach. What would be ideal is if a user could specify a time in seconds beyond which the notification would be issued. I am most interested in this for processes that take minutes to hours, rather than a few seconds to run in the foreground, and it would also be nice for background processes as well.
Thanks for setting me on the right track.
-- Bill
Messages sorted by:
Reverse Date,
Date,
Thread,
Author