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 issues when using Tmux #190

Closed
3 tasks done
Stianhn opened this issue Aug 3, 2022 · 9 comments
Closed
3 tasks done

Cursor issues when using Tmux #190

Stianhn opened this issue Aug 3, 2022 · 9 comments
Assignees

Comments

@Stianhn
Copy link

Stianhn commented Aug 3, 2022

General information

When working outside of tmux the cursor works fine, showing an beam style cursor when in insert mode. But when Im working inside tmux it`s always showing a block cursor.

Alactritty
MacOS 12.4
oh-my-zsh
zsh 5.8.1
zvm 0.8.5

Basic examination

  • I have read through the README page
  • I have the latest version of zsh-vi-mode
  • I have tested with another terminal program
@oopjot
Copy link

oopjot commented Aug 12, 2022

Could you provide your .zshrc file? Please make sure you load all your plugins before sourcing oh-my-zsh.sh script.

@jeffreytse jeffreytse self-assigned this Aug 12, 2022
@poetaman
Copy link

It works fine on my end, you might also want to report $ infocmp $TERM both inside and outside tmux. Most such issues have something to do with the settings of terminfo.

@michal-cab
Copy link

michal-cab commented Aug 24, 2022

also have this issue and can't change cursor type - it is still nonblinking beam (normal mode) and nonblinking block (insert mode)
also it is not working even if i am outside of tmux...

ubuntudtudio 21.04 / konsole 21.12.3
zsh 5.8.1
oh-my-zsh
zvm 0.8.5

.zshrc:

#                                                                                                                                                                                                                                            
export PATH=$HOME/.local/bin:/usr/local/bin:$PATH                                                                                                                                                                                            
                                                                                                                                                                                                                                             
export ZSH="$HOME/.oh-my-zsh"                                                                                                                                                                                                                
                                                                                                                                                                                                                                             
ZSH_THEME="gallois"                                                                                                                                                                                                                          
                                                                                                                                                                                                                                             
#plugine before sourcing                                                                                                                                                                                                                     
plugins=(git zsh-vi-mode)                                                                                                                                                                                                                    
                                                                                                                                                                                                                                             
source $ZSH/oh-my-zsh.sh                                                                                                                                                                                                                     
                                                                                                                                                                                                                                             
 if [[ -n $SSH_CONNECTION ]]; then                                                                                                                                                                                                           
   export EDITOR='nvim'                                                                                                                                                                                                                      
 else                                                                                                                                                                                                                                        
   export EDITOR='nvim'                                                                                                                                                                                                                      
 fi                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                             
autoload -Uz compinit                                                                                                                                                                                                                        
                                                                                                                                                                                                                                             
compinit                                                                                                                                                                                                                                     
                                                                                                                                                                                                                                             
zstyle ':completion:*' auto-description 'specify: %d'                                                                                                                                                                                        
zstyle ':completion:*' completer _expand _complete _correct _approximate                                                                                                                                                                     
zstyle ':completion:*' format 'Completing %d'                                                                                                                                                                                                
zstyle ':completion:*' group-name ''                                                                                                                                                                                                         
zstyle ':completion:*' menu select=2                                                                                                                                                                                                         
eval "$(dircolors -b)"                                                                                                                                                                                                                       
zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}                                                                                                                                                                                
zstyle ':completion:*' list-colors ''                                                                                                                                                                                                        
zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s                                                                                                                                                   
zstyle ':completion:*' matcher-list '' 'm:{a-z}={A-Z}' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=* l:|=*'                                                                                                                                        
zstyle ':completion:*' menu select=long                                                                                                                                                                                                      
zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s                                                                                                                                                           
zstyle ':completion:*' use-compctl false                                                                                                                                                                                                     
zstyle ':completion:*' verbose true                                                                                                                                                                                                          
                                                                                                                                                                                                                                             
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31'                                                                                                                                                             
zstyle ':completion:*:kill:*' command 'ps -u $USER -o pid,%cpu,tty,cputime,cmd'                                                                                                                                                              
                                                                                                                                                                                                                                             
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh                                                                                                                                                                                                       
                                                                                                                                                                                                                                             
#restore alsamixer status                                                                                                                                                                                                                    
#stored with alsactl --file ~/.config/asound.state store                                                                                                                                                                                     
alsactl --file ~/.config/asound.state restore                                                                                                                                                                                                
                                                                                                                                                                                                                                             
check_tmux.sh

and in zsh-vi-mode i added:

ZVM_INSERT_MODE_CURSOR=$ZVM_CURSOR_BLINKING_UNDERLINE                                                                                                                                                                                        
ZVM_NORMAL_MODE_CURSOR=$ZVM_CURSOR_BLINKING_BLOCK                                                                                                                                                                                            
ZVM_OPPEND_MODE_CURSOR=$ZVM_CURSOR_UNDERLINE 

@RannyArcher
Copy link

try this command: export VI_MODE_SET_CURSOR=true

if it works, add it to the zshrc

@Stianhn
Copy link
Author

Stianhn commented Sep 15, 2022

export VI_MODE_SET_CURSOR=true

That did not change anything for me.

@fpotter
Copy link

fpotter commented Sep 22, 2022

@Stianhn Are you running over mosh by chance? Apparently mosh doesn't respect the updated cursor: mobile-shell/mosh#1084

@gilitos92
Copy link

I had this same problem and it was because I installed the plugin with Brew, so most likely you have installed it with an external package manager too.
Re-install/run through OhMyZsh (by cloning into $HOME/.oh-my-zsh/custom/plugins) and then add "zsh-vi-mode" into your .zshrc in the plugins section of OMZ.
I don't know what does Tmux do on init that messes with the loading of the cursors of the plugin.

@Hubro
Copy link

Hubro commented Jan 21, 2023

I've installed zsh-vi-mode using Antigen in my .zshrc file, and the cursor modes work fine in tmux.

@vcup
Copy link

vcup commented Oct 17, 2023

I've installed zsh-vi-mode using Antigen in my .zshrc file, and the cursor modes work fine in tmux.

I am also, but the cursor not work in vim, it always show a block. if i escape tmux then cursor showed normal in vim.

@Stianhn Stianhn closed this as completed Mar 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants