Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing Vim Cursor in MobaXTerm

I recently updated from MobaXterm 7.7 to MobaXterm 8.1 on my Windows machine for my SSH and X11 needs.

Since doing that, my Vim cursors have stopped changing when I enter different modes (i.e. insert mode) -- the cursor is now always a block cursor. Additionally, I noticed that if I change the default Terminal Cursor setting in MobaXterm, the console cursor remains a block cursor regardless (a possible bug?).

In the past, I added the following lines into my .vimrc file to address cursor shapes, but since updating to MobaXterm 8.1, this no longer works.

let &t_ti.="\e[1 q"
let &t_SI.="\e[3 q"
let &t_EI.="\e[1 q"
let &t_te.="\e[0 q"

I'm curious what is causing this.

After doing some research, I found the following line in MobaXterm 8.0 changelog:

Improvement: The embedded terminal is now based on a plain PuTTY engine

If I recall correctly, you have limited ability to change cursors within the PuTTY environment. Does this mean I can no longer change my Vim cursors while using MobaXterm? Alternatively, is there some .vimrc command I don't know about? Is this all just a bug or is it intended?

Thanks!

like image 457
fish Avatar asked Aug 30 '15 17:08

fish


People also ask

How do I change my cursor in MobaXTerm?

It sounds as if MobaXterm's developers do not want to bother with applying their patch. Checking current PuTTY source (0.65), it has (as expected) "limited" ability to change the cursor's appearance. It handles these escape sequences when the SCO/ANSI feature is enabled: \e[=2c (block cursor)

How do I change the cursor in Vim?

Changing the cursor color in insert modeUsing gvim with the defaults, the cursor shape is a block when in n-v-c modes (normal mode, or visual selection mode, or command mode while entering a colon command), and the shape changes to a vertical bar when in i (insert) mode. The color and blink rates do not change.

How do I change the cursor color in MobaXTerm?

In my case that program is MobaXTerm. I discovered the following sequence: Settings - Terminal - Cursor. At that point, selecting a cursor color causes the cursor in the bash shell to be displayed in the desired color.


1 Answers

None of PuTTY's cursor-related control sequences end with "q". It sounds as if MobaXterm's developers do not want to bother with applying their patch.

Checking current PuTTY source (0.65), it has (as expected) "limited" ability to change the cursor's appearance. It handles these escape sequences when the SCO/ANSI feature is enabled:

  • \e[=2c (block cursor)
  • \e[=1c (normal cursor)
  • \e[0c (hidden cursor)
  • \e[=x;yC (draws cursor from scan lines x to y)

Also, the cursor can be changed to/from a block cursor (for normal "VT220" mode) using \e[?34h and \e[?34l.

like image 56
Thomas Dickey Avatar answered Oct 13 '22 14:10

Thomas Dickey