1

I use KDE and for vim in Konsole, I have such commands in my .vimrc:

" Konsole
" solid underscore
let &t_SI = "\033]50;CursorShape=2\007"
" solid block
let &t_EI = "\033]50;CursorShape=0\007"

But it does not work when I use tmux. Why is that and what can I do to get this to work?

  • Do you need to simulate vim in tmux? – PersianGulf Oct 5 '14 at 10:55
  • I do not understand your question. I use kde and konsole as a terminal emulator. I'm learning tmux just now. But cursor changing in vim (like in gvim) doesn't work when using tmux. (It works in konsole without using tmux). – yazu Oct 5 '14 at 17:23
2

According to my vim config:

tmux will only forward escape sequences to the terminal if surrounded by a DCS sequence (see)

So when my config detects that vim is running in tmux (if exists('$TMUX')) it will surround every escape sequence with "\ePtmux;\e" and "\e\\"

My escape sequences are xterm specific, but I guess you need to perform a similar trick for Konsole.

N.b.: "\e" is the same as "\033"

Your case would look like (sorry, untested):

" Konsole
" solid underscore
let &t_SI = "\033]50;CursorShape=2\007"
" solid block
let &t_EI = "\033]50;CursorShape=0\007"

if exists('$TMUX')
  let &t_SI = "\ePtmux;\e" . &t_SI . "\e\\"
  let &t_EI = "\ePtmux;\e" . &t_EI . "\e\\"
endif

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.