From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23165 invoked by alias); 4 Aug 2012 23:11:24 -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: 17193 Received: (qmail 1926 invoked from network); 4 Aug 2012 23:11:22 -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=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <120804161046.ZM14799@torch.brasslantern.com> Date: Sat, 04 Aug 2012 16:10:46 -0700 In-reply-to: <61BB4B35-A02F-44F8-B793-A7F90543D25F@ucsc.edu> Comments: In reply to "William G. Scott" "command completion notification" (Aug 3, 11:08pm) References: <61BB4B35-A02F-44F8-B793-A7F90543D25F@ucsc.edu> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Re: command completion notification MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Aug 3, 11:08pm, William G. Scott wrote: } } In OS X, 10.8 (aka Mtn Lion), Apple has introduced a notification } system. Using gem, I installed a command-line utility called } terminal-notifier. } } This isn't particularly elegant. I would rather use this as a preexec } function, or something similar, so I wouldn't have to explicitly type } "tnot". However, there are only a small subset of commands I would } want to bind to a notification. 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. } Is it straightforward to somehow bind this to, say, control-return, or } some other modified return key sequence? 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).