add less to the default ignored commands.
also make drop_words really work, and drop any combination of
the to-be-dropped words from the command string.
That is, we remove the first occurence of
builtin, command, nocorrect, noglob, nohup and LANG=C,
in order to see the "real" command behind it.
Very helpful for aliases like alias man=nocorrect noglob man
which otherwise would beep - even when we dont want em too.
_prompt_ganneff_timestamp=${EPOCHSECONDS}
typeset -ga _prompt_ganneff_ignore
zstyle -a ':prompt:ganneff' bell_ignore _prompt_ganneff_ignore || \
_prompt_ganneff_timestamp=${EPOCHSECONDS}
typeset -ga _prompt_ganneff_ignore
zstyle -a ':prompt:ganneff' bell_ignore _prompt_ganneff_ignore || \
- _prompt_ganneff_ignore=( '$EDITOR' '$PAGER' sleep man ssh zsh watch )
+ _prompt_ganneff_ignore=( '$EDITOR' '$PAGER' sleep man ssh zsh watch less )
# In case the commands to ignore include variables (say $EDITOR), we want to
# store them once as variable - and once the variable expanded.
for (( i = 1; i <= ${#_prompt_ganneff_ignore}; i++ )) do
# In case the commands to ignore include variables (say $EDITOR), we want to
# store them once as variable - and once the variable expanded.
for (( i = 1; i <= ${#_prompt_ganneff_ignore}; i++ )) do
ran_long=$(( ${EPOCHSECONDS} - ${_prompt_ganneff_timestamp} >= ${_prompt_ganneff_belltime} ))
if (( ran_long )); then
has_ignored_cmd=0
ran_long=$(( ${EPOCHSECONDS} - ${_prompt_ganneff_timestamp} >= ${_prompt_ganneff_belltime} ))
if (( ran_long )); then
has_ignored_cmd=0
- drop_words=(builtin command nocorrect noglob)
+ drop_words=(builtin command nocorrect noglob nohup LANG=C)
for cmd in ${(s:;:)_prompt_ganneff_lastcmd//|/;}; do
for cmd in ${(s:;:)_prompt_ganneff_lastcmd//|/;}; do
+ for key in ${drop_words}; do
+ cmd=${cmd/${key}/}
+ done
words=(${(z)cmd})
util=${words[1]}
if (( ${drop_words[(i)$util]} <= ${#drop_words} )); then
words=(${(z)cmd})
util=${words[1]}
if (( ${drop_words[(i)$util]} <= ${#drop_words} )); then
## candidates and as such are the default. If you put variables here,
## we will additionally expand them at prompt setup time and so keep
## both, the variable itself as well as the expanded command ignored.
## candidates and as such are the default. If you put variables here,
## we will additionally expand them at prompt setup time and so keep
## both, the variable itself as well as the expanded command ignored.
-# zstyle ':prompt:ganneff' bell_ignore '$EDITOR' '$PAGER' sleep man ssh zsh watch
+# zstyle ':prompt:ganneff' bell_ignore '$EDITOR' '$PAGER' sleep man ssh zsh watch less
## Use color in prompt.
## COLORS is defined as true/false in 01_Terminfo.zsh depending on
## Use color in prompt.
## COLORS is defined as true/false in 01_Terminfo.zsh depending on