Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cursor insert mode style affects other applications #35

Closed
Hubro opened this issue Mar 2, 2021 · 3 comments
Closed

Cursor insert mode style affects other applications #35

Hubro opened this issue Mar 2, 2021 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@Hubro
Copy link

Hubro commented Mar 2, 2021

I enjoy using these cursor styles to clearly distinguish between normal mode and insert mode:

ZVM_INSERT_MODE_CURSOR=$ZVM_CURSOR_BLINKING_BEAM
ZVM_NORMAL_MODE_CURSOR=$ZVM_CURSOR_BLOCK

However, the insert mode cursor style is inherited by other applications, and those applications don't handle switching between cursor styles when switching modes, which makes the cursor permanently stay in the insert mode style until the application is exited.

For example, try starting Vim from the terminal, or simply start bash. Inside vim or bash, the insert mode cursor is permanently active, even when switching to normal mode. This is extremely distracting.

I wish zsh-vi-mode would "reset" the cursor style to default before executing a command, then set the custom style again when the command exits. This way applications like vim, bash, python and any other interactive CLI application would not be affected by it.

(Put a different way, temporarily set ZVM_CURSOR_STYLE_ENABLED=false while a process is running in the terminal)

@jeffreytse jeffreytse self-assigned this Mar 2, 2021
@jeffreytse jeffreytse added the enhancement New feature or request label Mar 2, 2021
@jeffreytse
Copy link
Owner

Hi @Hubro

Thanks for the reporting about some applications don't handle switching cursor styles, I will pay attention to enhance this cursor behavior for better experience.

Thanks and regards

jeffreytse added a commit that referenced this issue Mar 2, 2021
When we start a program (e.g. vim, bash, etc.) from the
command line, the cursor style is inherited by other
programs, so that we need to reset the cursor style to
default before executing a command and set the custom
style again when the command exits. This way makes any
other interactive CLI application would not be affected
by it.
@jeffreytse
Copy link
Owner

jeffreytse commented Mar 2, 2021

Hi @Hubro

🎉 This issue has been settled down and now it supports to auto restore cursor to user defualt when an interactive program (e.g. vim, bash, etc) starts. Please update your plugin to the latest version for the enhancement.

Thanks and regards

@Hubro
Copy link
Author

Hubro commented Mar 2, 2021

It works! Thanks for the quick fix :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants