New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use terminfo key codes instead of hardcoded ones for key bindings #1355
Conversation
Conflicts: lib/key-bindings.zsh
Esc+. works as "last arg" on both bash and zsh. Seems like a shame to introduce a new standard. Conflicts: lib/key-bindings.zsh
I just did an upgrade of oh-my-zsh, and the history-substring-search plugin broke. I fixed it by adding the following two lines to my personal zshrc (non oh-my-zsh) file.
I figured this out by doing I think this pull request is the better way to deal with this. Please merge it in! |
Thanks, F30, for this fix. I adopted your changes manually, but I hope they get merged to master soon. |
Tested in: lsb_release -a
Description: Ubuntu 12.10
Release: 12.10
zsh --version
zsh 5.0.0 (x86_64-unknown-linux-gnu) Applied manually: mv key-bindings.zsh key-bindings_original.zsh
wget https://raw.github.com/F30/oh-my-zsh/174c9177aa34b4c05bb5a1c6f637e6fa479a8e10/lib/key-bindings.zsh Really dirty but did the job, please merge this :) Thanks to @F30! |
+1 This is a good patch. Please merge! |
This did the trick for me. :) |
Please merge |
Use terminfo key codes instead of hardcoded ones for key bindings
After update oh-my-zsh with this patch, plugin history-substring-search don't work |
Hi @thuandt, I recommend you open a new issue to have a better chance of being seen. Within the new issue, make sure to add your system version ( |
+1 history search with up/down arrow key is broken... |
Hardcoded key escape sequences (such as
[[A
for arrow-up) serve their purpose in most cases, but not in any terminal configuration. It's a better practice to query the right codes dynamically from$terminfo
instead.I expect this to become a real-world problem as soon as recent Debian and Ubuntu versions become used more widely: Those ship with a
/etc/zsh/zshrc
which enables "application mode", in which oh-my-zsh's key bindings partially don't work. I've written down more about that problem on my blog.My commits migrate the key bindings to terminfo wherever possible. Please note that in order to use
$terminfo
, my code hast to activate the "application mode" as well and might therefore break custom hardcoded key bindings. I based my work on the documentation efforts by @kylewest from pull request #889.