Comments (7)
Even if the README says Ubuntu 12.04 users have to bind keys differently (and I'm on OSX), I found that binding ^[[A
and ^[[B
works for me.
Closing for now, but you may want to update the README.
from zsh-history-substring-search.
Same problem with Fedora 21.
Binding ^[[A and ^[[B works.
You may want to update README.md
from zsh-history-substring-search.
@RGBD done in c4a8356, thanks! 👍
from zsh-history-substring-search.
This isn't necessarily a platform-dependent problem per se; it depends on whether zsh
has been customized to set the cursor keypad to application mode while ZLE is active. The current Oh My Zsh and some Linux distros do so; the default is to not. The terminfo entries for the arrow keys and home/end only apply to their behavior in application cursor mode, not default cursor mode. (See man terminfo
.) Those platforms or systems where you're seeing the need to fall back to hardcoded values instead of terminfo entries are those where they have the default zsh
behavior of leaving the terminal in normal cursor mode while ZLE is active.
The behavior may also vary depending on what terminal and $TERM
value you are using.
from zsh-history-substring-search.
@apjanke can you point to where OMZ sets mentioned ZLE customization? I don't use OMZ, but want to replicate similar behavior in my dotfiles.
from zsh-history-substring-search.
Sure. It's done by using echoti smkx
/rmkx
in zle-line-init
and zle-line-finish
. This is set up in lib/key-bindings.zsh
in the core OMZ code. You'll also need to do a zmodload zsh/terminfo
first to make $terminfo
available.
if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then
function zle-line-init() {
echoti smkx
}
function zle-line-finish() {
echoti rmkx
}
zle -N zle-line-init
zle -N zle-line-finish
fi
My personal thinking is coming around to the idea that zsh
extensions and "plugins" that bind cursor keys (up/down/left/right/home/end) should bind both the $terminfo[kc*]
sequence and the corresponding hardcoded xterm normal-mode cursor sequence (^[[A
, ^[[B
, ^[[C
, ^[[D
, ^[[H
, ^[[F
), so they work regardless of whether the user's zsh
is configured to use application keypad mode while editing the command line. I haven't tested this much though, so I don't know if there are gotchas in practice.
from zsh-history-substring-search.
Thanks for detailed explanation, got it working for me.
from zsh-history-substring-search.
Related Issues (20)
- Release a new version HOT 2
- Not highlighting in zsh 5.9 HOT 13
- zsh-syntax-highlighting: unhandled ZLE widget 'history-substring-search-up' HOT 2
- integrate `history-substring-search-down` with existing widget
- Incompatibility with custom config setopt globsubst
- Modify your readme, bindkey does not work, as mentioned in readme HOT 2
- Need Help, i must "source .zshrc" first for the plugin to works HOT 2
- binding keys doesn't work?
- `(anon):local:1: bad option: -e` error HOT 7
- History not synced accross terminals. HOT 2
- Highlighting doesn't work when using both marlonrichert/zsh-autocomplete and zsh-users/zsh-syntax-highlighting HOT 2
- Shell is stuck on 100% cpu if last character is a pipe
- Add separate license file HOT 1
- Create release including `HISTORY_SUBSTRING_SEARCH_PREFIXED` HOT 2
- How to install on Ubuntu 22.04 (in WSL2) without Oh My Zsh? HOT 4
- Cannot search across in different terminal tab
- Not enough arguments for -U HOT 8
- .zshrc:XXX: no matches found: [plugins...] HOT 3
- Where do historical records exist? HOT 1
- How do I change the data source of a history command to histdb
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zsh-history-substring-search.