From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6411 invoked by alias); 5 Aug 2012 06:35:18 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 17194 Received: (qmail 5258 invoked from network); 5 Aug 2012 06:35:15 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_LOW,T_DKIM_INVALID autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at ucsc.edu does not designate permitted sender hosts) 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= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer :x-gm-message-state; bh=s23rSlBxt0IAIue94BWwaAh2VA+fZase7NJrV8ndLfQ=; b=n6wzsesGNbJvjcwlabxDl9mayjR5ntzX8iEryT25BF3qkvpfGfc3FfMQFSo6bFQW8a xzYPNOYnysiWlrPV4QeE9w+fnTR+3hulKhr0LSz6dhqun+Gm/xg4uFi6YYb16Yq7P/yL 3CYvENY4F+lfd6elSMIEeUlzd7LziTUE2BIwOBFXF28jNj9wQNUNNFtH8dDgus52WeIU u/W49ZJWlzaWrDpNJcfU3iDgnjp8dNyf67CXib1OpYPFMmvPrGA+VbT1y6DDl68YWfeo TIN19+h1hmpLGzeE78iwtOktqGggvjZCxRuQmyg7Dyd0vF6b3UOpA1gI0KfaglilLmQo jtjQ== Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.0 \(1485\)) Subject: Re: command completion notification From: William Scott In-Reply-To: <120804161046.ZM14799@torch.brasslantern.com> Date: Sat, 4 Aug 2012 20:43:18 -0700 Cc: zsh-users@zsh.org Content-Transfer-Encoding: quoted-printable Message-Id: <671E3B65-DB7D-4C76-B617-18A7EAB28CB9@ucsc.edu> References: <61BB4B35-A02F-44F8-B793-A7F90543D25F@ucsc.edu> <120804161046.ZM14799@torch.brasslantern.com> To: Bart Schaefer X-Mailer: Apple Mail (2.1485) X-Gm-Message-State: ALoCoQkqpUJ48Uls+fP/s8h6J4FkK3g7qS1EGizvHBPVKvwXIEtoXfex3tJBJ2KfWjIFypxp9L0q Dear Bart: Thanks for writing back. and for your advice. On Aug 4, 2012, at 4:10 PM, Bart Schaefer = wrote: >=20 > 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,=20 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. >=20 >=20 > There are two issues here: >=20 > (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. >=20 > (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: >=20 > tnot-widget() { BUFFER=3D"tnot $BUFFER"; zle accept-line } > zle -N tnot-widget >=20 > and then bindkey for whatever character is sent by control-return, to > the tnot-widget. >=20 > 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