fix terminal cursor
This commit is contained in:
parent
a4fecb61a4
commit
b5d7b831c9
@ -23,13 +23,14 @@ bindkey -v
|
||||
zle-keymap-select() {
|
||||
if [[ ${KEYMAP} == vicmd ]] ||
|
||||
[[ $1 = 'block' ]]; then
|
||||
echo -ne '\e[1 q'
|
||||
echo -ne '\e[2 q'
|
||||
|
||||
elif [[ ${KEYMAP} == main ]] ||
|
||||
[[ ${KEYMAP} == viins ]] ||
|
||||
[[ ${KEYMAP} = '' ]] ||
|
||||
[[ $1 = 'beam' ]]; then
|
||||
echo -ne '\e[5 q'
|
||||
|
||||
fi
|
||||
}
|
||||
|
||||
@ -38,11 +39,22 @@ zle -N zle-keymap-select
|
||||
# Use beam shape cursor on startup.
|
||||
echo -ne '\e[5 q'
|
||||
|
||||
# Use beam shape cursor for each new prompt.
|
||||
preexec() {
|
||||
_fix_cursor() {
|
||||
echo -ne '\e[5 q'
|
||||
}
|
||||
|
||||
precmd_functions+=(_fix_cursor)
|
||||
|
||||
# Set cursor style (DECSCUSR), VT520.
|
||||
# 0 -> blinking block.
|
||||
# 1 -> blinking block (default).
|
||||
# 2 -> steady block.
|
||||
# 3 -> blinking underline.
|
||||
# 4 -> steady underline.
|
||||
# 5 -> blinking bar, xterm.
|
||||
# 6 -> steady bar, xterm.
|
||||
|
||||
|
||||
|
||||
bindkey -M viins 'jk' vi-cmd-mode
|
||||
bindkey ' ' magic-space # do history expansion on space
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user