From 016955c64b5c7a1c90af47a1a26ffe466736a12b Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Fri, 26 Jun 2015 14:27:43 +0200 Subject: [PATCH] zshrc: drop 'setopt nonomatch' configuration This is something many experienced Zsh users sometimes complain about for our config, so let's get this fixed. The behaviour of 'setopt nonomatch' brings the Zsh behaviour closer to what Bash does, though people should get used to proper quoting and get the default Zsh behaviour also with grml-zshrc. Short explanation for the behaviour of 'setopt nonomatch' by Frank: | If there's no *.txt in $PWD that command line will not execute with Zsh's default behaviour. You have to quote: "*.txt" | If there *is* a *.txt file in $PWD, the command will not work as expected: Thus quoting makes the call sane. | nonomatch makes that expansion as it is done in bash: *.txt => No match? => insert '*.txt' Short demonstration: | % setopt nonomatch | % for f in *.foo ; echo $f | *.foo | % setopt nomatch | % for f in *.foo ; echo $f | zsh: no matches found: *.foo The setting is provided as an example in etc/skel/.zshrc now. Signed-off-by: Michael Prokop Acked-By: Frank Terbeck Acked-By: Evgeni Golov --- etc/skel/.zshrc | 3 +++ etc/zsh/zshrc | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/etc/skel/.zshrc b/etc/skel/.zshrc index ddb49c0..8695b4d 100644 --- a/etc/skel/.zshrc +++ b/etc/skel/.zshrc @@ -104,6 +104,9 @@ fi ## add `|' to output redirections in the history #setopt histallowclobber +## try to avoid the 'zsh: no matches found...' +#setopt nonomatch + ## warning if file exists ('cat /dev/null > ~/.zshrc') #setopt NO_clobber diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index e5b6814..b6c8375 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -388,9 +388,6 @@ setopt extended_glob # display PID when suspending processes as well setopt longlistjobs -# try to avoid the 'zsh: no matches found...' -setopt nonomatch - # report the status of backgrounds jobs immediately setopt notify -- 2.1.4