history-substring-search just doesn't work since I update my distro from 12.04 to 12.10.
I mean that when I type smth, eg ls and press up-arrow button, it shows me last history item, not started from ls.
My .zshrc
$ cat .zshrc | grep -v -E "^# .*"
ZSH=$HOME/.oh-my-zsh
ZSH_THEME="clean" # fletcherm
plugins=(git history-substring-search command-not-found)
source $ZSH/oh-my-zsh.sh
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
ZSH version
$ zsh --version
zsh 5.0.0 (i686-pc-linux-gnu)
I've just done a clean install of ubuntu 12.10 on a new machine and this seems to be happening to me too.
ZSH: zsh 5.0.0 (x86_64-unknown-linux-gnu), OMZ: 22f827e122187032afb1f473d19a4238899e8ecd, dotfiles
Debian Wheezy - same issue - all I did was update oh-my-zsh today (and the issue is present on a server I have running Squeeze)
_edit_ ZSH 4.3.10-14 on the Squeeze machine and 4.3.17-1 on Wheezy
I have this issue too, on two different machines, both on ubuntu 12.10 x64. One of them was an upgrade from 12.04, the other one was a clean install. history-substring-search doesn't work on either.
zsh 5.0.0 (x86_64-unknown-linux-gnu)
+1, Ubuntu 12.10, clean install.
It seems a zsh bug in Ubuntu - https://bugs.launchpad.net/ubuntu/+source/zsh/+bug/1048212
Great! It works! Thanks cutalion!
When Oh My ZSH updated on my mac (10.8.2) this started happening to me as well =(
Same issue here with unity 12.10. Even work around didn't work for me.
DEBIAN_PREVENT_KEYBOARD_CHANGES=yes
does not work for me either :(
System: Ubuntu 12.10
@cutalion's suggestion worked for me.
Any news here? I have the same problem and the workaround does not work for me.
@sotte the default setup started working for me again except on one machine where I had enabled some plugins that weren't enabled on the working ones. I disabled them and it works out of the box again.
Double check which plugins you have enabled and test if any of them is still breaking it.
Here is my .zshrc. No plugin is enabled. The workaround has no effect.
ZSH=$HOME/.oh-my-zsh
ZSH_THEME="robbyrussell"
#DEBIAN_PREVENT_KEYBOARD_CHANGES=yes
plugins=(history-substring-search)
source $ZSH/oh-my-zsh.sh
hmm.
What version of ZSH do you have?
What commit of Oh-My-Zsh are you at?
_EDIT_ also - did you comment out the workaround because it had no effect or did you add it already commented?
I tried it with and without the workaround. No effect.
omz is the current version: 615e41b0ecdb25acba513fd09619bd56c2eb24eb
zsh 5.0.0 (x86_64-unknown-linux-gnu)
I have no problems with Ubutu 12.04 and zsh 4.3.17 (x86_64-unknown-linux-gnu). The config is the same. The workaround is not activated.
Same problem for me, and setting DEBIAN_PREVENT_KEYBOARD_CHANGES=yes doesn't help.
Strange that this workaround don't work for some people...I have export DEBIAN_PREVENT_KEYBOARD_CHANGES=yes in my .zshrc and backward search works perfect for me under Ubuntu 12.10.
On 11.02.2013, at 1:48, Claes Mogren [email protected] wrote:
Same problem for me, and setting DEBIAN_PREVENT_KEYBOARD_CHANGES=yes doesn't help.
—
Reply to this email directly or view it on GitHub..
In case it's helpful. I have Ubuntu 12.10, zsh 5.0.0 (x86_64-unknown-linux-gnu) with the same issue initially.
Putting "export DEBIAN_PREVENT_KEYBOARD_CHANGES=yes" in .zshrc does not fix the issue.
But putting "DEBIAN_PREVENT_KEYBOARD_CHANGES=yes" into .zshenv appears solving the problem for me.
Could be related to the order of setting this variable.
xubuntu 12.10
updating .zshrc with DEBIAN_PREVENT_KEYBOARD_CHANGES=yes solved the issue
Same issue here. Updated to Ubuntu 12.10. Code below doesn't help:
Fixed with adding this into .zshenv (not .zshrc):
DEBIAN_PREVENT_KEYBOARD_CHANGES=yes
did you try putting it in .zshrc and .zshenv ?
On 12 March 2013 09:22, Povilas BalzaraviÄŤius [email protected]:
Same issue here. Updated to Ubuntu 12.10. Code below doesn't help:
DEBIAN_PREVENT_KEYBOARD_CHANGES=yes
—
Reply to this email directly or view it on GitHubhttps://github.com/robbyrussell/oh-my-zsh/issues/1433#issuecomment-14761849
.
Yes, found solution immediately after posted comment. Editing .zshrc is not required at all. Thanks!
editing .zshrc sometimes it works... but shouldn't!
.zshenv is the one to be edited
Worked for my ubuntu
Worked for me THANKS Damn it made my day :D
PS : Linux Mint 14 (based on ubuntu 12.10)
Worked for me
Ubuntu 13.04, zsh 5.0.0-2ubuntu3
@cutalion - Great, it works, many thanks! :)
@robbyrussell - Are you going to make this as part of the installation script? If not, then probably this issue should be closed, as it seems is ubuntu-specific... (or?)
this is something I've suffered with for many months, and just dealt with. Finding this fix just made my month.
Its working for me but i am getting this message whenever I use it
_history-substring-search-end:9: _zsh_highlight: function definition file not found
system: ubuntu 13.04
I have the same problem on OS X 10.8.3, zsh 5.0.2 (x86_64-apple-darwin12.2.0), newest omz master
sorry, my bad. I didn't realize that zsh-syntax-highlighting doesn't come with default installation of oh-my-zsh. Installing zsh-syntax-highlighting in plugins directory solved the issue. Commenting 9th line in the function _history-substring-search-end function in history-substring-search.zsh also works if you don't use syntax highlighting.
Just to add another data point, adding DEBIAN_PREVENT_KEYBOARD_CHANGES=yes to ~/.zshenv worked for me on Ubuntu 13.04 64-bit, ZSH 5.0.0
None of these suggestions were working for me on Ubuntu 13.04 with zsh 5.0.0. The thing that finally worked for me was to put the following at the BOTTOM of my .zshrc:
source $ZSH/plugins/history-substring-search/history-substring-search.zsh
I do a fair amount of customizations in my .zshrc including RVM (ruby version manager). I am guessing that something else was conflicting with my history-substring-search.
Funny. On a different Ubuntu 13.04 machine of mine, the echo "DEBIAN_PREVENT_KEYBOARD_CHANGES=yes" >> ~/.zshenv worked like a champ. Oh well. I'm glad it is working regardless. BTW, I'm happy there are some good solutions on bug.
+1. Same problem on Ubuntu 12.10 x64 Desktop with zsh 5.0.0 and rvm
source $ZSH/plugins/history-substring-search/history-substring-search.zs at the bottom of my .zshrc does the trick.
It's somewhere in the debian plugin, worked again for me as soon as i'd deactivated the debian plugin in .zshrc.
Confusing is, reactivating of the debian plugin don't break it again...
I ran into this on Debian 7.2, and nothing worked until I added source $ZSH/plugins/history-substring-search/history-substring-search.zs at the end of my .zshrc .
On my Mac (zsh 5.0.2) the commit which introduces the defect seems to be https://github.com/zsh-users/zsh-history-substring-search/commit/82fbef5132b44c5d039e7d25972d9351c5936bc2
It's not working here too. zsh 5.0.2 and Ubuntu 13.10.
None of the above fixes worked either...
The DEBIAN_PREVENT_KEYBOARD_CHANGES fix in .zshenv worked for me. Using Zsh 5.0.0 and Ubuntu 13.04.
Got it working on Ubuntu 13.10 by adding the paste-safe plugin (suggested here: https://github.com/robbyrussell/oh-my-zsh/issues/1720).
No DEBIAN_PREVENT_KEYBOARD_CHANGES=yes and no source $ZSH/plugins/history-substring-search/history-substring-search.zsh (both didn't work anymore).
@jvf - :+1: That solved the issue for me too (and home/end work again!) :)
Fixed on Ubuntu 13.10 by adding those two line in my .zshrc
bindkey '\eOA' history-substring-search-up
bindkey '\eOB' history-substring-search-down
I also have DEBIAN_PREVENT_KEYBOARD_CHANGES=yes in my zshenv
Neither adding paste-safe nor using the bindkey-trick worked for me. I still have no substring history…
Perhaps there is something wrong in general with my plugin setup…
plugins=(vagrant cabal git git-flow gitignore bundler rails github rvm sublime composer history-sub string-search command-not-found zsh-syntax-highlighting)
on my ubuntu 12.04 i added this to .zshrc:
zmodload zsh/terminfo
bindkey "$terminfo[kcuu1]" history-substring-search-up
bindkey "$terminfo[kcud1]" history-substring-search-down
and I've DEBIAN_PREVENT_KEYBOARD_CHANGES=yes in my .zshenv
@Eustachy's trick works for me.
As @Eustachy suggested, using
bindkey "$terminfo[kcuu1]" history-substring-search-up
bindkey "$terminfo[kcud1]" history-substring-search-down
instead of
bindkey '\e[A' history-substring-search-up
bindkey '\e[B' history-substring-search-down
fixed it for me (on Mac OS X, will test my Ubuntu machine at the beginning of next week) and is a lot cleaner than the paste-safe hack.
To add a (possible) explanation:
The problem seems to be 174c9177aa34b4c05bb5a1c6f637e6fa479a8e10 introduced 9 days ago through PR https://github.com/robbyrussell/oh-my-zsh/pull/1355. This commit changed the keybindings in lib/key-bindings.zsh from
bindkey '^[[A' up-line-or-search # start typing + [Up-Arrow] - fuzzy find history forward
bindkey '^[[B' down-line-or-search # start typing + [Down-Arrow] - fuzzy find history backward
to
bindkey "${terminfo[kcuu1]}" up-line-or-search # start typing + [Up-Arrow] - fuzzy find history forward
bindkey "${terminfo[kcud1]}" down-line-or-search # start typing + [Down-Arrow] - fuzzy find history backward
When one now attempts to override the keybindings from lib/key-bindings.zsh with '\e[A' (or '^[[A') and '\e[B' (or '^[[B') this doesn't work anymore, so one has to use the terminfo key codes kcuu1 and kcud1.
+1
@Eustachy's trick works for me.
@Eustachy / @jvf thanks so much for the fix
Please test PR #2511 which tries to fix this, +1 it if it works.
@Eustachy & @jvf ... thank you!
@tomek that worked for me. I had a feeling it had something to to with the term I was using (I'm also using tmux on occasion so the history substring sometimes works then doesn't)
For Mac OS X users, I have added this:
bindkey "$terminfo[kcuu1]" history-substring-search-up
bindkey "$terminfo[kcud1]" history-substring-search-down
after this line:
source $ZSH/oh-my-zsh.sh
now it is working like a charm :)
The fix mentioned by @jvf here worked for me on OSX 10.9.2 also!
@robbyrussell This issue has been open for a year and a pull request (#2511) ready for about a month now. Any chance on seeing this merged soon?
/cc @seriyps
Works for me
The most recent oh-my-zsh update just broke this for me again on Mac OS 10.9.2
@billcarroll - Yeah, for me it broke again too (a few days back actually, but I wouldn't be able to pin-point which update).
If it weren't annoying, it would be funny how often this brakes! :-/
I'm experiencing this issue on Fedora 20, and have been for some months. Adding DEBIAN_PREVENT_KEYBOARD_CHANGES=yes to .zshenv did not change anything. Moving 'history-substring-search' to the end of the plugin list in .zshrc did not change anything.
I notice that it works fine on NetBSD, through tmux, with TERM=screen.
adding
bindkey '\e[A' history-substring-search-up
bindkey '\e[B' history-substring-search-down
after loading omz works for me, with TERM=screen-256color
@zweifisch Awesome! That's great, thank you!
FWIW, that also works with TERM=xterm-256color (and through tmux)
Is a fix planned for this?
Here's what I use to make it work again:
# history-substring-search stopped working; see `man terminfo`
# keyboard generates cuu1/cud1 instead of kcuu1/kcud1
bindkey "$terminfo[cuu1]" history-substring-search-up
bindkey "$terminfo[cud1]" history-substring-search-down
This bug started to appear for me recently. None of the solutions given above works for me.
I'm having the same issue. On the latest (96e4e5d) with Mac OSX 10.9.5. Here's my plugin setup:
plugins=(git osx history-substring-search)
Strangely, if I source ~/.oh-my-zsh/plugins/history-substring-search/history-substring-search.zsh the plugin directly it works just fine. Any thoughts?
Going to close this one out... and hope that it's resolved for folks. (we can open up new issues as necessary)
I'm having this issue since a few days, on Debian, and Mac OS 10.10.3. None of the tips above is working.
For me it appeared to be something I did corrupted the .zcompdump / .zcompdump.zwc files on Mac. I trashed the files and restarted the shell and my issue appears to be gone.
broken on OS X again for me after the last update
also running into the issue. As m6w6 fix worked:
bindkey "$terminfo[cuu1]" history-substring-search-up
bindkey "$terminfo[cud1]" history-substring-search-down
I'm running just fine in OSX under gnu screen inside iTerm. Try to close all screen and iTerm and start again after update zsh and oh-my-zsh.
This started happening again with zsh recent update. None of the above mentioned suggestions are working. No .zshenv file in my machine.
This is the returned error:
_history-substring-search-end:13: _zsh_highlight: function definition file not found
I don't have zsh-syntax-highlighting folder in my plugins folder ~/.oh-my-zsh/plugins/. I doubt that _zsh_highlight is supposed to be imported from zsh-syntax-highlighting.
zsh 5.0.8 (x86_64-apple-darwin15.0)
OS X El Capital 10.11.6
Can someone please point me to the solution?
I think _zsh_highlight should be used carefully by checking if it is available. Here is the line reference.
Commenting out this line, works as a workaround for this problem. But I hope there will be a release with the fix.
Same error here as what @sgsvenkatesh reported.
@shadowhand The issue as resolved for me a few weeks back after updating zsh to the latest version. You should try it.
This happened after upgrading to current master. Appears to have gone away again.
Same issue on osx. Commenting out the call to _zsh_highlight worked for me. Highlighting works fine even without it.
Most helpful comment
For me it appeared to be something I did corrupted the .zcompdump / .zcompdump.zwc files on Mac. I trashed the files and restarted the shell and my issue appears to be gone.