do remote ssh connection in my tmux terminal (zsh) and remote shell is also zSH.
[devops@postgres-prod]~% vi /var/lib/pgsql/9.6/etc/postgresql.conf^A0A^A^A^E^A
So it doesn't react on Ctrl+A, Ctrl+E
do remote ssh connection in my tmux terminal (zsh) and remote shell is also zSH.
[devops@postgres-prod]~% vi /var/lib/pgsql/9.6/etc/postgresql.conf^A0A^A^A^E^A
So it doesn't react on Ctrl+A, Ctrl+E
Okay found what was the problem.
I had 'vim' mode zsh enabled by default for some reason.
I had to put the following into ~/.zshrc
# Emacs mode
bindkey -e
https://dougblack.io/words/zsh-vi-mode.html
Now everything works as expected.
You can keep using vim mode in zsh. I used these bindkey in .zshrc to fix the issue:
bindkey "^[[H" beginning-of-line
bindkey "^[[F" end-of-line
You may find other settings also helpful:
# use vim input mode
set -o vi
bindkey -v
# enable ctrl R to search history
bindkey '^R' history-incremental-search-backward
# enable navigation using Home and End key
#bindkey "${terminfo[khome]}" beginning-of-line
#bindkey "${terminfo[kend]}" end-of-line
bindkey "^[[H" beginning-of-line
bindkey "^[[F" end-of-line
# enable Del key to delete char
bindkey "^[[3~" delete-char
# enable Alt + Bs key to delete word (forward)
bindkey "^[^?" backward-delete-word
# enable Alt + Del key to delete word (backword)
bindkey "^[^[[3~" delete-word