zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users@zsh.org
Subject: Re: command completion notification
Date: Sat, 04 Aug 2012 16:10:46 -0700	[thread overview]
Message-ID: <120804161046.ZM14799@torch.brasslantern.com> (raw)
In-Reply-To: <61BB4B35-A02F-44F8-B793-A7F90543D25F@ucsc.edu>

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).


  reply	other threads:[~2012-08-04 23:11 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 [this message]
2012-08-05  3:43   ` William Scott
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=120804161046.ZM14799@torch.brasslantern.com \
    --to=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).