zsh-users
 help / color / mirror / code / Atom feed
From: William Scott <wgscott@ucsc.edu>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: zsh-users@zsh.org
Subject: Re: command completion notification
Date: Sat, 4 Aug 2012 20:43:18 -0700	[thread overview]
Message-ID: <671E3B65-DB7D-4C76-B617-18A7EAB28CB9@ucsc.edu> (raw)
In-Reply-To: <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@brasslantern.com> 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


  reply	other threads:[~2012-08-05  6:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-04  6:08 William G. Scott
2012-08-04 23:10 ` Bart Schaefer
2012-08-05  3:43   ` William Scott [this message]
2012-08-05 18:21     ` Bart Schaefer
2012-09-20  9:04     ` Oliver Kiddle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=671E3B65-DB7D-4C76-B617-18A7EAB28CB9@ucsc.edu \
    --to=wgscott@ucsc.edu \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).