7696122 / evil-terminal-cursor-changer

:smiling_imp: Chagning cursor by mode for evil on terminal.
80 stars 12 forks source link

Cursor color & shape do not revert when leaving Emacs #12

Open waldnercharles opened 8 years ago

waldnercharles commented 8 years ago

After leaving emacs via Evil's :q, the cursor does not revert either its color or shape. This can be reproduced via :q or pkill emacs from another terminal.

I'm using xterm as my terminal.

7696122 commented 8 years ago

I don't know how to detect cursor type when Emacs running on terminal. Especially iTerm, Konsole.

aaronjensen commented 7 years ago

Is there a way to revert it manually upon leaving? For example, I'd just want to return it to a box on leaving. I tried delete-frame-hook but that didn't work.

aaronjensen commented 7 years ago

For now I added a cursor reset to my prompt. Something like this:

if [ -n "$TMUX" ]; then
  local _reset_cursor=$'\e[0 q'
else
  local _reset_cursor=$'\e[2 q'
fi

PROMPT='%{${_reset_cursor}%}...'