zsh-vi-mode icon indicating copy to clipboard operation
zsh-vi-mode copied to clipboard

Cursor is initially block shaped and switches to block shape after time

Open mskar opened this issue 4 years ago • 12 comments

When opening a new terminal, the cursor is initially block shaped image when it should be in bar/beam shaped image To switch to beam shape, I have to type a full normal mode command (e.g. dd) or press i/a/I/A, but then it switches back to block after a short time.

mskar avatar Feb 17 '21 21:02 mskar

I tried this other plugin and don't have this same problem: https://github.com/softmoth/zsh-vim-mode Is there a way to disable the cursor functionality of zsh-vi-mode?

mskar avatar Feb 17 '21 22:02 mskar

Hi @mskar

You can custom your cursor style (See here). I will add an option to support disabling the custom cursor style in the future.

Thanks and regards

jeffreytse avatar Feb 18 '21 02:02 jeffreytse

Hi @mskar

About the issue that it switches back to block after a short time, are you using the Tmux?

Thanks and regards

jeffreytse avatar Feb 18 '21 02:02 jeffreytse

Hi @jeffreytse, yes, I am using tmux.

mskar avatar Feb 18 '21 13:02 mskar

Hi @mskar

It's reasonable for the cursor switching back to block. Because the tmux is a terminal multiplexer, there are multiple terminal in the same session, so any one program of this session could change the cursor. So I think you have a vim program in the session and the (n)vim will set the cursor style by timer automatically.

Thanks and regards

jeffreytse avatar Feb 18 '21 14:02 jeffreytse

Hi @mskar

Now the commit (48c7d66) has provided the ZVM_CURSOR_STYLE_ENABLED option to disable the cursor style feature, if you don't want the cursor style, you can set it to false.

Thanks and regards

jeffreytse avatar Feb 21 '21 02:02 jeffreytse

Hello @jeffreytse and @mskar, I wanted to confirm that I also experienced this behavior when I was used nvim and this plugin in a tmux session. I have used the ZVM_CURSOR_STYLE_ENABLED variable as @jeffreytse suggested so that now I always have a consistent style for the cursor. While it would be nice to have different styles for the cursor, I think that it is better if the cursor always signifies the correct state. Thanks for clarifying this issue @jeffreytse!

gkapfham avatar Apr 14 '21 22:04 gkapfham

Hi @gkapfham , this issue is the same as another one #11, and currently the cursor will be auto updated when typing, so you can still enable this cursor style feature.

jeffreytse avatar Apr 15 '21 01:04 jeffreytse

Same as #11

jeffreytse avatar Apr 15 '21 01:04 jeffreytse

Hi @jeffreytse, I tried setting ZVM_CURSOR_STYLE_ENABLED to false, as described in the README but the cursor always remains block shaped. I tried it both inside and outside the configuration function. It seems like zsh-vi-mode is still overriding the cursor style settings in my .zshrc. Is there a way to tell the plugin to not do anything related to the cursor at all and just let my .zshrc handle cursor style?

I also tried setting set -ga terminal-overrides '*:Ss=\E[%p1%d q:Se=\E[ q' in my tmux config, as described here. Adding ZVM_LINE_INIT_MODE=$ZVM_MODE_INSERT instead of ZVM_LINE_INIT_MODE=$ZVM_MODE_INSERT seems to prevent the cursor starting out block shaped, but the cursor still reverts to being block shaped.

mskar avatar Sep 21 '21 13:09 mskar

Hi @mskar

Once you disable the cursor style feature, the cursor style will follow your default settings of your terminal emulator, and this plugin will not apply any styles to the terminal emulator, for most of terminal emulators, block shape is default.

Thanks and Regards

jeffreytse avatar Sep 22 '21 07:09 jeffreytse

Hi @jeffreytse, I took a look at this again and I noticed that the cursor shape is fine outside of tmux. This has to be related to something in my tmux config.

mskar avatar Dec 01 '21 19:12 mskar