Vim in xterm : Mouse cursor not changing based on mouse mode

0

When I use vim with gnome-terminal or yakuake, and I have mouse on ( set mouse+=a ), then I see an arrow as mouse pointer, and when I have mouse off, then the "insert" sign as mouse pointer. However, in xterm (and urxvt), I see only mouse pointer. How to ensure that I see the distinction in xterm as well? Or if not using mouse, then some other clearly visible distinction?

0fnt

Posted 2015-06-10T15:37:13.150

Reputation: 1 741

Have you looked at :help termcap-cursor-shape? – Heptite – 2015-06-10T18:07:49.247

Is it possible to send the escape sequence mentioned via a command? Sorry not much of vim-settings expert, i use vim for fast movement/editing mostly. Also, this should be noted for other readers, if this works, it would only be for cursor and would not fix the mouse pointer issue I mention in the question – 0fnt – 2015-06-10T19:04:16.207

Oops, my mistake. I don't think console Vim can change the mouse shape. What you're seeing is almost certainly a feature of the terminals themselves. – Heptite – 2015-06-10T19:42:48.393

Answers

0

vim does have a feature for changing the mouse appearance (see term_cursor_shape) but it depends upon names normally not found in a termcap description: SI and EI (vim uses termcap names, even though termcap is rare compared to terminfo). The usual names are vi (invisible), ve (normal) and vs (very visible).

If you happen to know a control sequence that works, you can use it in the corresponding t_SI and t_EI settings within vim.

Here are a few links to help:

Outside of the documented vi/ve/vs, you are unlikely to find the same control sequences used for xterm versus urxvt. xterm implements (see XTerm Control Sequences) the DECSCUSR control which provides combinations of blinking/nonblinking and block/underline cursors.

Thomas Dickey

Posted 2015-06-10T15:37:13.150

Reputation: 6 891

As the above comments suggest, the term_cursor_shape isn't for the mouse cursor, but the terminal cursor. – Heptite – 2015-06-11T00:38:52.573

The OP wants to see a distinct cursor in insert-mode. vim documents a way to do that. – Thomas Dickey – 2015-06-11T01:03:03.800