zsh: don't change cursor style on linux TTY
This commit is contained in:
parent
26dadff7f2
commit
07e242e06b
|
@ -30,14 +30,12 @@ key[Backspace]=${terminfo[kbs]}
|
|||
# Finally, make sure the terminal is in application mode, when zle is
|
||||
# active. Only then are the values from $terminfo valid.
|
||||
function zle-line-init () {
|
||||
if [[ "${TERM}" != "linux" ]] && [[ "${TERM}" != "dumb" ]]
|
||||
then
|
||||
if [[ "${TERM}" != "linux" ]] && [[ "${TERM}" != "dumb" ]]; then
|
||||
echoti smkx
|
||||
fi
|
||||
}
|
||||
function zle-line-finish () {
|
||||
if [[ "${TERM}" != "linux" ]] && [[ "${TERM}" != "dumb" ]]
|
||||
then
|
||||
if [[ "${TERM}" != "linux" ]] && [[ "${TERM}" != "dumb" ]]; then
|
||||
echoti smkx
|
||||
fi
|
||||
}
|
||||
|
@ -45,14 +43,19 @@ function zle-line-finish () {
|
|||
# Change cursor based on mode
|
||||
print -n '\e[6 q'
|
||||
function zle-keymap-select() {
|
||||
if [[ "${KEYMAP}" == "viins" || "${KEYMAP}" == "main" ]]; then
|
||||
print -n '\e[6 q' # beam
|
||||
else
|
||||
print -n '\e[2 q' # block
|
||||
if [[ "${TERM}" != "linux" ]] && [[ "${TERM}" != "dumb" ]]; then
|
||||
if [[ "${KEYMAP}" == "viins" || "${KEYMAP}" == "main" ]]; then
|
||||
print -n '\e[6 q' # beam
|
||||
else
|
||||
print -n '\e[2 q' # block
|
||||
fi
|
||||
fi
|
||||
}
|
||||
function _fixcursor() {
|
||||
print -n '\e[6 q'
|
||||
if [[ "${TERM}" != "linux" ]] && [[ "${TERM}" != "dumb" ]]; then
|
||||
print -n '\e[6 q'
|
||||
# print -n "\e]12;magenta\007"
|
||||
fi
|
||||
}
|
||||
add-zsh-hook precmd _fixcursor
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user