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 style maintained across terminals #11

Open
oars opened this issue Feb 10, 2021 · 11 comments
Open

Cursor style maintained across terminals #11

oars opened this issue Feb 10, 2021 · 11 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request verified This issue was already verified

Comments

@oars
Copy link

oars commented Feb 10, 2021

With TMux the cursor style is changed across all terminals.

Ideally I would love to be able to have a block style outside of the shell. So even if I was in insert mode with a pipe, when I go into vim for example I'd like it to go back to a block. Similarly if I go to a different terminal I'd like it to be independent, although I don't know how feasible that is.

@jeffreytse
Copy link
Owner

Hi @oars

Since Tmux is a terminal multiplexer, simply speaking, multiple windows and panes share a single terminal window. So when you switch between pannels, you will meet that the cursor style was not changed, in fact it is the same terminal as we known, unless it is updated by the program in another panel, but luckly the vim or nvim will update the cursor stlyle when you press some keys and auto update by its timer), this plugin will also update the cursor style when you press any key.

Thanks and regards

@jeffreytse jeffreytse self-assigned this Feb 11, 2021
@jeffreytse jeffreytse added the question Further information is requested label Feb 11, 2021
@jeffreytse jeffreytse added bug Something isn't working enhancement New feature or request verified This issue was already verified and removed question Further information is requested labels Mar 4, 2021
@jeffreytse
Copy link
Owner

jeffreytse commented Mar 4, 2021

Hi @oars

Thanks for your patience, this issue has been fixed on #35. Welcome to update your plugin to the latest version.

Thanks and regards

@androidfans
Copy link

androidfans commented Mar 17, 2021

Mar-17-2021 22-32-24

@jeffreytse can still repro this bug. it always makes me want press an i to enter insert mode when i am already in insert mode

@jeffreytse
Copy link
Owner

jeffreytse commented Mar 17, 2021

Hi @oars , in fact, this is not a bug, since you are using a terminal multiplexer, the zsh can not get the events of changing terminal, it is only one terminal for the virtual terminal emulators (such as iTerm, Xfce, etc.), now there is no a better solution for this issue. If you open a nvim and a zsh in the same time, you will observe that the zsh's cursor will change to block style after waiting for a while, since the nvim will update the cursor style by timer automatically.

@androidfans
Copy link

ok. may be tmux has some configuration to generate this event. let me find

@androidfans
Copy link

androidfans commented Mar 17, 2021

@jeffreytse
set -g focus-events on
may be helped.
just want sleep .will try it tomorow

@jeffreytse
Copy link
Owner

jeffreytse commented Mar 17, 2021

@androidfans I knew this option and this is a configure of tmux, is it? The key to the problem is that I can get the event callback when the window is focused back.

@jeffreytse
Copy link
Owner

Hi @androidfans , in fact this issue already was added to my todo list, I will focus on this issue and try to settle it down, any updates I will update here, thanks you for the help.

@androidfans
Copy link

androidfans commented Mar 18, 2021

yes, it's tmux.
have found another link may help
tmux/tmux#2059

@HsunGong
Copy link

Neither #11 (comment) nor tmux/tmux#2059 helps though.

@zhyu
Copy link

zhyu commented Dec 22, 2021

I'm having the same issue.

Before using zsh-vi-mode, I was using the vi-mode plugin of oh-my-zsh, which has a VI_MODE_RESET_PROMPT_ON_MODE_CHANGE option solves this issue. I wonder can we do something similar here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request verified This issue was already verified
Projects
None yet
Development

No branches or pull requests

5 participants