bad pattern: history_items=(v auto... #92

Closed
jedahan opened this Issue Jan 27, 2016 · 17 comments

3 participants

@jedahan
~/.zplug/repos/tarruda/zsh-autosuggestions v0.1.x
❯ _zsh_autosuggest_get_suggestion:2: bad pattern: history_items=(v autosuggestions.zsh
v_zsh_autosuggest_get_suggestion:2: bad pattern: history_items=(v autosuggestions.zsh
v _zsh_autosuggest_get_suggestion:2: no matches found: history_items=()

getting these error with my zshrc, which can be found https://github.com/jedahan/dotfiles/blob/osx/home/.zshrc . Might be something having to do with my history options? sourced from https://github.com/sorin-ionescu/prezto/blob/master/modules/history/init.zsh

@ericfreese
zsh-users member

Thanks @jedahan. Looks like we're seeing the same issue over in #88 as well.

@ericfreese
zsh-users member

I've tried using those history options by themselves, and all seems to work for me. So I'm guessing it's something else.

@ericfreese
zsh-users member

@jedahan Can you try disabling your plugins and other extra functions/aliases temporarily to see if the problem still exists?

@ronjouch

@ericfreese (follow-up to your question in #88)

To "What happens if you run echo ${history[(R)*]} in the command line?", I get the same thing as I do without loading the plugin: eight huges lines with up to 62000 columns. I can't post this online, can you precise what you're looking for?

To "Are you sourcing any other files?": yes, I'm using a few other plugins, some standalone and some from oh-my-zsh. Will try commenting a few to isolate if one of them causes the conflict.

@ronjouch

Re. Commenting all my oh-my-zsh plugins (virtualenvwrapper colored-man-pages httpie npm pip git python sudo history-substring-search docker zsh-navigation-tools zsh-syntax-highlighting) and all my standalone source ... (autojump, nvm) didn't help, the problem persists.

@jedahan
> cat ~/.zshrc
HISTFILE="${ZDOTDIR:-$HOME}/.zhistory"
source ~/.zplug/zplug.zsh || { git clone https://github.com/b4b4r07/zplug2.git ~/.zplug && source ~/.zplug/zplug.zsh }
zplug "tarruda/zsh-autosuggestions", at:v0.1.x
zplug load
zle-line-init() { autosuggest_start }
zle -N zle-line-init

still get the same issue

@ericfreese
zsh-users member

I can't post this online, can you precise what you're looking for?

Was just wondering if it would give the same bad pattern error.

the problem persists

Thanks for this. It looks like it's most likely something in the contents of your history that's not being handled right.

Have to run to work now, but will look into this more tonight. In the mean time, if you feel like digging, it'd be great if you could narrow in on which entry/entries in your history is causing the issue. Might also try clearing or renaming your history file to see if it solves the problem. I believe it should.

@jedahan

Cleared the history, my history file now looks like

>cat ~/.zhis*
: 1453910546:0;cat hi
: 1453910557:0;cat ~/.zhis*
>echo ${history[(R)*]}
cat ~/.zhis* cat hi
@ericfreese
zsh-users member

@jedahan still having the problem?

@ericfreese
zsh-users member

What version of zsh?

@jedahan

❯ zsh --version
zsh 5.0.8 (x86_64-apple-darwin15.0)

@jedahan

installing 5.2 from homebrew fixed it all, thanks

@jedahan jedahan closed this Jan 27, 2016
@ericfreese
zsh-users member

Oh hell yeah. Would be nice if it worked in 5.0 though...

@ronjouch

installing 5.2 from homebrew fixed it all, thanks

@jedahan same here, thanks for the pointer! I was running 5.0.2 because Ubuntu 14.04LTS; after compiling zsh 5.2 I no longer have the issue. For anyone in the same boat,

# install the dependencies required to build zsh
sudo apt-get build-dep zsh

# get the latest zsh from http://zsh.sourceforge.net/Arc/source.html , extract it, and cd in the folder
(...)

# build
./configure --prefix=~/.zsh-homebuilt
make
make install

# link to your fresh binary in a folder in your $PATH is before the distro-maintained one (/usr/bin/zsh)
sudo ln -s ~/.zsh-homebuilt/bin/zsh /usr/local/bin/zsh

@ericfreese just on Ubuntu side, there are many users still on 5.0 and 5.1 (packages.ubuntu.com/zsh), would be nice if it worked with these versions indeed...

@ericfreese
zsh-users member

would be nice if it worked with these versions indeed

Totally agreed. And now that I actually know how to reproduce it, it just might happen ;)

Thanks y'all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment