vim-tmux-focus-events
vim-tmux-focus-events copied to clipboard
Leftover ^[[O characters on screen on blur
When leaving a tmux pane with Vim inside, there is a visible ^[[O string left where cursor was. This isn't text that is being processed, just a bit annoying.. any clue?
Hey,
which tmux command do you use when this appears?
I tried regular tmux pane navigation (with prefix + arrows), switching previous/next window or even leaving session with prefix + s but I don't get that.
Hmmm. Maybe because I'm using vim-tmux-navigator with its Ctrl+h/j/k/l bindings... ?
I also managed to find a way to reproduce it consistently by using tmux-sessionist prefix + g feature.
au FocusGained * silent redraw! in vimrc seems to fix this.
I'm not sure I wanna add this line to the plugin though, because native tmux behavior does not trigger the unwanted characters..
For what it is worth, I was seeing this problem and I am using vim-tmux-navigator as well. I used bruno's approach with a slight tweak: au FocusLost * silent redraw!.
Just found this after a journey into improving my number/relativenumber behavior while using terminal vim + tmux. Thank you bruno and liaden for the tip!
" Toggle relative numbers on FocusLost
autocmd FocusLost * :set number norelativenumber
" Using vim-tmux-navigator bindings, on FocusLost ^[[O was left behind
autocmd FocusLost * silent redraw!
autocmd FocusGained * :set number relativenumber
" Toggle relative numbers in insert mode
autocmd InsertEnter * :set number norelativenumber
autocmd InsertLeave * :set number relativenumber
This must somehow be terminal related because I never see it in Secure Shell from my Chromebook but I see it in GNOME terminal 3.18.3.