ohmyzsh / ohmyzsh

🙃 A delightful community-driven (with 2,400+ contributors) framework for managing your zsh configuration. Includes 300+ optional plugins (rails, git, macOS, hub, docker, homebrew, node, php, python, etc), 140+ themes to spice up your morning, and an auto-update tool that makes it easy to keep up with the latest updates from the community.
https://ohmyz.sh
MIT License
173.38k stars 25.88k forks source link

history-substring-search doesn't work after update to Ubuntu 12.10 [has workaround] #1433

Closed seriyps closed 9 years ago

seriyps commented 11 years ago

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)
BRMatt commented 11 years ago

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

ajpaulson commented 11 years ago

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

OffbeatPlanet commented 11 years ago

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)

cutalion commented 11 years ago

+1, Ubuntu 12.10, clean install. It seems a zsh bug in Ubuntu - https://bugs.launchpad.net/ubuntu/+source/zsh/+bug/1048212

cutalion commented 11 years ago

Fortunately, there is a workaround.

Put this line to ~/.zshenv:

DEBIAN_PREVENT_KEYBOARD_CHANGES=yes
OffbeatPlanet commented 11 years ago

Great! It works! Thanks cutalion!

daubman commented 11 years ago

When Oh My ZSH updated on my mac (10.8.2) this started happening to me as well =(

Adarsh-Barik commented 11 years ago

Same issue here with unity 12.10. Even work around didn't work for me.

ranjanashish commented 11 years ago
DEBIAN_PREVENT_KEYBOARD_CHANGES=yes

does not work for me either :(

System: Ubuntu 12.10

mmacedo commented 11 years ago

@cutalion's suggestion worked for me.

sotte commented 11 years ago

Any news here? I have the same problem and the workaround does not work for me.

ajpaulson commented 11 years ago

@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.

sotte commented 11 years ago

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
ajpaulson commented 11 years ago

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?

sotte commented 11 years ago

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)

sotte commented 11 years ago

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.

mogren commented 11 years ago

Same problem for me, and setting DEBIAN_PREVENT_KEYBOARD_CHANGES=yes doesn't help.

corpix commented 11 years ago

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 notifications@github.com 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..

newgene commented 11 years ago

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.

Asmmund commented 11 years ago

xubuntu 12.10 updating .zshrc with DEBIAN_PREVENT_KEYBOARD_CHANGES=yes solved the issue

Pawka commented 11 years ago

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
Asmmund commented 11 years ago

did you try putting it in .zshrc and .zshenv ?

On 12 March 2013 09:22, Povilas Balzaravičius notifications@github.comwrote:

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 .

Pawka commented 11 years ago

Yes, found solution immediately after posted comment. Editing .zshrc is not required at all. Thanks!

Asmmund commented 11 years ago

editing .zshrc sometimes it works... but shouldn't! .zshenv is the one to be edited

mmichelli commented 11 years ago

Worked for my ubuntu

Xqua commented 11 years ago

Worked for me THANKS Damn it made my day :D

PS : Linux Mint 14 (based on ubuntu 12.10)

thuandt commented 11 years ago

Worked for me Ubuntu 13.04, zsh 5.0.0-2ubuntu3

quasipedia commented 11 years ago

@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?)

LeviRosol commented 11 years ago

this is something I've suffered with for many months, and just dealt with. Finding this fix just made my month.

Adarsh-Barik commented 11 years ago

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

deiga commented 11 years ago

I have the same problem on OS X 10.8.3, zsh 5.0.2 (x86_64-apple-darwin12.2.0), newest omz master

Adarsh-Barik commented 11 years ago

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.

nickchappell commented 11 years ago

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

mrinterweb commented 11 years ago

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.

mrinterweb commented 11 years ago

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.

hartator commented 11 years ago

+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.

chn42 commented 11 years ago

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...

gkop commented 10 years ago

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 .

arialdomartini commented 10 years ago

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

lucasfcunha commented 10 years ago

It's not working here too. zsh 5.0.2 and Ubuntu 13.10.

None of the above fixes worked either...

ncanceill commented 10 years ago

The DEBIAN_PREVENT_KEYBOARD_CHANGES fix in .zshenv worked for me. Using Zsh 5.0.0 and Ubuntu 13.04.

jvf commented 10 years ago

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).

quasipedia commented 10 years ago

@jvf - :+1: That solved the issue for me too (and home/end work again!) :)

lucasfcunha commented 10 years ago

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

NobbZ commented 10 years ago

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)
tomek commented 10 years ago

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

NobbZ commented 10 years ago

@Eustachy's trick works for me.

jvf commented 10 years ago

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.

donnykurnia commented 10 years ago

+1 @Eustachy's trick works for me.

karlhungus commented 10 years ago

@Eustachy / @jvf thanks so much for the fix