lanfuchao / zsh-templates-osx

Automatically exported from code.google.com/p/zsh-templates-osx
GNU General Public License v2.0
0 stars 0 forks source link

history_ignore_dups does not work #12

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Uncomment hist_ignore_dups in 111.environment.options.zsh
2.
3.

What is the expected output? What do you see instead?

Duplicates in history should be, but are not, ignored. Furthermore, this output 
is seen when I open a new shell (via ssh in this case)

Last login: Sun Dec 19 11:53:37 2010 from mbp.local
/Users/db/Library/init/zsh/zshrc.d/111_environment.options.zsh:186: command not 
found: hist_ignore_dups
Time: 11:55  up 5 days, 12:31, 8 users, load averages: 1.04 1.05 1.06 
mini.lan::/Users/db
Initializing zsh version number 4.2.7 
/Users/db/Library/init/zsh/zshrc_local.d/111_environment.options.zsh:186: 
command not found: hist_ignore_dups
/Users/db/Library/init/zsh/zshrc.d/111_environment.options.zsh:186: command not 
found: hist_ignore_dups
Time: 11:55  up 5 days, 12:31, 8 users, load averages: 1.04 1.05 1.06 
mini.lan::/Users/db
Initializing zsh version number 4.2.7 
/Users/db/Library/init/zsh/zshrc_local.d/111_environment.options.zsh:186: 
command not found: hist_ignore_dups

Besides the error message it looks like the shell executes the 111-file three 
times. That can't be right, can it?

What version of the product are you using? On what operating system?

The header of the 111-file:

# File:  $ZDOT/zshrc.d/environment.options.zsh
# sourced from /etc/zshrc
# Version: 2.0.0

on Snow Leopard.

Please provide any additional information below.

Original issue reported on code.google.com by dbo...@gmail.com on 19 Dec 2010 at 11:03

GoogleCodeExporter commented 8 years ago
Ok, I have figured the problem. The layout in 111_environment.options.zsh:186 
is not ideal. You can't just uncomment lines you want to apply, you have to 
preprend them with setopt, e.g.,

# some option
# hist_ignore_dups
# another option

would become
# some option
setopt hist_ignore_dups
# another option

Actually, a smarter design of the file would be without \ (to ignore line 
breaks) and prepend all options with setopt and then comment the options one is 
not interested in.

Original comment by dbo...@gmail.com on 24 Jan 2011 at 1:53