Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: making zsh beep



Charles Hallenbeck <chuckh@xxxxxxxxx>:
> 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



Messages sorted by: Reverse Date, Date, Thread, Author