zsh-users
 help / color / mirror / code / Atom feed
* making zsh beep
@ 2006-05-20 19:30 Charles Hallenbeck
  2006-05-20 20:02 ` Frank Terbeck
  0 siblings, 1 reply; 2+ messages in thread
From: Charles Hallenbeck @ 2006-05-20 19:30 UTC (permalink / raw)
  To: zsh list

[-- Attachment #1: Type: text/plain, Size: 635 bytes --]

Hi all,

I have installed zsh as a login shell and have done a bunch of 
configuring, but there is one feature I would like it to do that bash 
used to do, and cannot seem to locate any info on it.

In bash, backspacing on an empty command line produced a beep. How can I 
make zsh do that?

I have setopt beep in a startup file, and ambiguous filename expansions 
cause a beep. But backspacing on an empty command line does not. What 
have I overlooked?

Thanks,

Chuck

-- 
The Moon is Waning Crescent (45% of Full)
Get downloads from http://www.mhcable.com/~chuckh
  and remember, INFORMATION WANTS TO BE FREE!

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: making zsh beep
  2006-05-20 19:30 making zsh beep Charles Hallenbeck
@ 2006-05-20 20:02 ` Frank Terbeck
  0 siblings, 0 replies; 2+ messages in thread
From: Frank Terbeck @ 2006-05-20 20:02 UTC (permalink / raw)
  To: zsh list

Charles Hallenbeck <chuckh@hhs48.com>:
> I have installed zsh as a login shell and have done a bunch of 
> configuring, but there is one feature I would like it to do that bash 
> used to do, and cannot seem to locate any info on it.
> 
> In bash, backspacing on an empty command line produced a beep. How can I 
> make zsh do that?
> 
> I have setopt beep in a startup file, and ambiguous filename expansions 
> cause a beep. But backspacing on an empty command line does not. What 
> have I overlooked?

Hi Charles,
If you'd like the line editor to beep, you'll have to add a widget
that does that. I don't think that there's an option for that.
Try:

backward-delete-char-beep() {
  if (( CURSOR == 0 )) ; then
    zle beep ;
  fi ; 
  zle backward-delete-char
}
zle -N backward-delete-char-beep
bindkey "^?" backward-delete-char-beep

That should do the trick.

Regards, Frank


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-05-20 20:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-20 19:30 making zsh beep Charles Hallenbeck
2006-05-20 20:02 ` Frank Terbeck

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