I have looked for a solution to this OhMyZSH!
problem for a few days now, but can't find a solution.
Admittedly, I do not understand how zle
really works, same for bindkey
. Same goes for the way terminal emulators send "control sequences", and what the "terminal type" means (xterm
, versus xterm-256-color
, and others). Same for the "Application mode"
The setup
I have 2 machines where the latest version of OhMyZSH is installed, commit c3b072
:
- machine A: SLES 11 SP4, running
zsh 4.3.6 (x86_64-suse-linux-gnu)
- machine B: Ubuntu 16.04, running
zsh 5.1.1 (x86_64-ubuntu-linux-gnu)
I connect to either machine using Putty running on Windows, with terminal type xterm
, and in UTF-8 translation mode.
My zshrc
files are pretty much vanilla OhMyZSH
templates, I have just changed the prompt to dieter
on machine A, and powerlevel-9k
[https://github.com/bhilburn/powerlevel9k] on machine B.
What I observe on machine A (aka the "bad" one)
When I edit my command line, the Left and Right cursor keys move one whole word (instead of 1 single character).
Home and End keys though, bring the cursor to the beginning and end of the line, as expected.
This described behaviour applies when in emacs
mode (bindkey -e
).
When I go to vim
mode (bindkey -v
), the Left and Right arrows move 1 character, but the Home and End keys don't move the cursor to the beginning and end of the line. Instead, they switch the case of the character under the cursor.
What I observe on machine B (aka the "good" one)
Left and Right keys move the cursor one single char. Home and end keys move the cursor to the beginning and end of line resp. Ctrl+A and Ctrl+E combos bring my cursor to the beginning and end resp.
This is the behaviour I would like for all my shells.
What I have found so far
I think it is a bindkey
issue. But I know next to nothing about that, and I've had a hard time finding any doc on this zsh
built-in.
Running zsh -v
on both machines at login time gives very different results, despite similar .zshrc
files.
Could someone explain to me what is causing these 2 machines to behave so differently, and how I can change my configuration so that consistency is regained, and all my shells behave like on machine B (aka the "good" one)?
I'm sure you will let me know if you need more information that I don't know is needed.
Many thanks
zsh -v
in your question. – EightBitTony Jan 23 '18 at 13:51zsh -v
traces have been added to this gist: https://gist.github.com/guneemwelloeux/34ee3943ac32847895dc4c57f74c5ff7. Careful though, the files are 6k lines long each, so the page is pretty heavy to load. – Gunee Jan 24 '18 at 10:40