Mouse not working last 20% of screen

26 views
Skip to first unread message

Kennedy, Marcus A.

unread,
Mar 16, 2020, 12:10:58 PM3/16/20
to vim...@googlegroups.com

Hello,

This issue has been going on for about 6-8 years and on multiple systems. I cannot
use the mouse when it is in the last 20% of the screen (no click, scroll, select, etc).
I'm using Slackware 14.2 with the stock versions of KDE, Konsole, and vim.

I attempted mouse operations on the right side of the screen with pico and it works.

Anyone have any ideas as to why this is happening?

Thanks,
Andy

Shlomi Fish

unread,
Mar 16, 2020, 12:32:34 PM3/16/20
to Kennedy, Marcus A., vim...@googlegroups.com
Hi Andy,

On Mon, 16 Mar 2020 16:09:55 +0000
"Kennedy, Marcus A." <Marcus....@Rocket.com> wrote:

> Hello,
>
> This issue has been going on for about 6-8 years and on multiple systems. I
> cannot use the mouse when it is in the last 20% of the screen (no click,
> scroll, select, etc). I'm using Slackware 14.2 with the stock versions of
> KDE, Konsole, and vim.
>
> I attempted mouse operations on the right side of the screen with pico and it
> works.
>

In konsole on kde plasma5 on fedora 31 x86-64 , clicking the mouse does nothing
in any part of the screen with all of 'nano', 'pico' and 'vim'. It works fine
in the gtk+ based gvim, which isn't a console/terminal app.

> Anyone have any ideas as to why this is happening?
>
> Thanks,
> Andy
>



--

Shlomi Fish https://www.shlomifish.org/
https://github.com/shlomif/what-you-should-know-about-automated-testing

Flock aims to be the browser for the social web, but I found it to be the
completely anti-social browser.

Please reply to list if it's a mailing list post - http://shlom.in/reply .

Tony Mechelynck

unread,
Mar 16, 2020, 12:42:15 PM3/16/20
to vim_use
I don't know WHY this happens but I confirm THAT it happens in my
Konsole terminal, version 18.12.3, where v:termresponse is
^[[>0;115;0c — clicking the mouse moves the cursor, but only if no
farther than in virtual column 223. This is a _screen_ column and
applies to any of the screen lines of a wrapped file line.

In a "real" xterm, I don't know, because there I have 'columns' set to
200 and it takes the whole screen width (the font is a little bigger
and a lot uglier).

In gvim I have set a minuscule font (Bitstream Vera Sans Mono 4) to
test what happens, and I can move the cursor to the very right margin
by clicking.

Oh, and my Vim version is 8.2.389, Big, GUI-enabled, with GTK2 GUI.

Best regards,
Tony.

Gary Johnson

unread,
Mar 16, 2020, 12:50:06 PM3/16/20
to vim...@googlegroups.com
Try

set ttymouse=sgr

See

:help 'ttymouse'

HTH,
Gary

Marius Gedminas

unread,
Mar 16, 2020, 12:57:44 PM3/16/20
to vim...@googlegroups.com
On Mon, Mar 16, 2020 at 05:41:55PM +0100, Tony Mechelynck wrote:
> On Mon, Mar 16, 2020 at 5:10 PM Kennedy, Marcus A.
> <Marcus....@rocket.com> wrote:
> > This issue has been going on for about 6-8 years and on multiple systems. I cannot
> > use the mouse when it is in the last 20% of the screen (no click, scroll, select, etc).
> > I'm using Slackware 14.2 with the stock versions of KDE, Konsole, and vim.
> >
> > I attempted mouse operations on the right side of the screen with pico and it works.
> >
> > Anyone have any ideas as to why this is happening?
>
> I don't know WHY this happens but I confirm THAT it happens in my
> Konsole terminal, version 18.12.3, where v:termresponse is
> ^[[>0;115;0c — clicking the mouse moves the cursor, but only if no
> farther than in virtual column 223. This is a _screen_ column and
> applies to any of the screen lines of a wrapped file line.

Check the 'ttymouse' setting. The "xterm" mouse protocol doesn't support
columns beyond 223.

I'm using gnome-terminal and my vim automatically detects this and sets
ttymouse to sgr, which doesn't have the 223-column limit.

Try manually forcing :set ttymouse=sgr, see if that helps.

Assuming it does: I don't know if vim can autodetect Konsole, given that
it self-reports as xterm 115. According to :help 'ttymouse', the sgr
protocol was added in xterm 277.

HTH,
Marius Gedminas
--
"question = (to) ? be : !be;" -- Shakespeare
signature.asc

Tony Mechelynck

unread,
Mar 16, 2020, 12:58:05 PM3/16/20
to vim...@googlegroups.com
Yeah, sgr mouse will be set if an xterm (or pseudo-xterm) version is
>= 277 (per the middle number in v:termresponse). Since my konsole
pretends to be xterm version 115, Vim does _not_ recognize it as
sgr-capable. My "real" xterm, OTOH, is version 330, so there it would
work even if 'columns' were higher.

Without sgr capability, an xterm only "sees" the mouse if no farther
right than column 223.

Best regards,
Tony.

Tony Mechelynck

unread,
Mar 16, 2020, 1:05:00 PM3/16/20
to vim...@googlegroups.com
Update: manually setting ttymouse=sgr in konsole 18.12.3 makes it
work, even though it only admits to xterm equivalent version 115,
which would normally mean ttymouse=xterm2.

Best rgards,
Tony.

Kennedy, Marcus A.

unread,
Mar 16, 2020, 1:13:26 PM3/16/20
to vim...@googlegroups.com

> Try
>
> set ttymouse=sgr
>

Wow. I should have asked this ages ago.

Thanks Gary, Marius, and Tony!

Andy

Tony Mechelynck

unread,
Mar 16, 2020, 1:14:02 PM3/16/20
to vim...@googlegroups.com
OK, I'll add the following to my vimrc, but it is a hack, and not
guaranteed to work:

au TermResponse *
\ if &ttym == 'xterm2' | set ttym=sgr | endif

Best regards,
Tony.

On Mon, Mar 16, 2020 at 6:04 PM Tony Mechelynck

meine

unread,
Mar 16, 2020, 2:37:33 PM3/16/20
to vim...@googlegroups.com
On Mon, Mar 16, 2020 at 04:09:55PM +0000, Kennedy, Marcus A. wrote:
>
> I cannot use the mouse when it is in the last 20% of the screen

I don't want to be a nuisance, but the whole idea of Vim is that you
only use the keyboard, because it is faster and more precise.

Admit it takes some time to re-train using your computer, but believe
me: using just Vim keystrokes is the best thing in editing.

//meine

Tony Mechelynck

unread,
Mar 16, 2020, 2:45:39 PM3/16/20
to vim_use
Well, I don't want to be a nuisance, but the whole idea of Vim is that
there are several ways to do one thing: use hjkl when it suits you,
use arrow keys when it suits you, use the mouse when it suits you, in
fact use whatever is available. If the whole idea of Vim were never to
use the mouse, it wouldn't suport it. Same thing for the arrow keys.

Best regards,
Tony.

Kennedy, Marcus A.

unread,
Mar 16, 2020, 2:58:11 PM3/16/20
to vim...@googlegroups.com

>>
>> I cannot use the mouse when it is in the last 20% of the screen
>
>I don't want to be a nuisance, but the whole idea of Vim is that you
>only use the keyboard, because it is faster and more precise.
>
>Admit it takes some time to re-train using your computer, but believe
>me: using just Vim keystrokes is the best thing in editing.
>
>//meine


Thanks for the suggestion meine!

I'm old. I'm old school. October of '93 when I started with vim and Linux there was no
GUI, only the ttys on Alt-F1 - Alt-F7. There was no mouse either as I usually used my
two serial comports as modem connections (PS2 didn't come out until later and I couldn't
afford a Cyclades).

The mouse is useful sometimes. Usually when I'm attempting to scroll one of the right
windows up or down without moving my cursor from the place I'm at.

So, yes, I use the keyboard about 90% of the time.

That other 10% was beginning to bug me ;)!

Andy

Bram Moolenaar

unread,
Mar 16, 2020, 4:09:28 PM3/16/20
to vim...@googlegroups.com, Kennedy, Marcus A.
Maybe you have an idea what to do with that pile of punched cards?
Somehow I don't have any papertape... :-)

--
Ten bugs in the hand is better than one as yet undetected.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Kennedy, Marcus A.

unread,
Mar 16, 2020, 4:32:59 PM3/16/20
to vim...@googlegroups.com

> Maybe you have an idea what to do with that pile of punched cards?
> Somehow I don't have any papertape... :-)

After that one election, haven't we had enough discussions about chads ;)?

That was the biggest bunch of crap I've ever seen. . . and I'm in Alabama.
We have VERY large piles of crap all over ;)

Andy

Tony Mechelynck

unread,
Mar 16, 2020, 5:14:13 PM3/16/20
to vim_use, Kennedy, Marcus A.
On Mon, Mar 16, 2020 at 9:09 PM Bram Moolenaar <Br...@moolenaar.net> wrote:
> Maybe you have an idea what to do with that pile of punched cards?
> Somehow I don't have any papertape... :-)

Punch 80 times octal 07777 in binary mode in each of them, throw away
the cards but keep the confetti, and use them ne next time weddings
will be permitted.

Best regards,
Tony.

Benjamin Esham

unread,
Mar 17, 2020, 1:57:11 AM3/17/20
to vim...@googlegroups.com
Tony Mechelynck wrote:

> On Mon, Mar 16, 2020 at 6:04 PM Tony Mechelynck
> <antoine.m...@gmail.com> wrote:
>
>> Update: manually setting ttymouse=sgr in konsole 18.12.3 makes it
>> work, even though it only admits to xterm equivalent version 115,
>> which would normally mean ttymouse=xterm2.
>>
>> Best rgards,
>> Tony.
>
> OK, I'll add the following to my vimrc, but it is a hack, and not
> guaranteed to work:
>
> au TermResponse *
> \ if &ttym == 'xterm2' | set ttym=sgr | endif
>
> Best regards,
> Tony.

I don't suppose your terminal emulator sets $TERM_PROGRAM? (As far as I've
been able to tell, this environment variable is a macOS-ism, but if you can
use it it seems like it might solve your problem neatly.)

Benjamin

Tony Mechelynck

unread,
Mar 17, 2020, 7:02:52 AM3/17/20
to vim_use
No it doesn't. "set | less" at the bash prompt lists (among others)
all environment variables in alphabetical order, and the only one
whose name starts with T is TERM=xterm-256color

In a "real" xterm there are two of them, namely TERM=xterm and
TS1=$'\E7\E]2;%s@%s:%s\a\E]1;%s\a\E8' ; in a non-X console (e.g.
Ctrl-Alt-F2) it's just TERM=linux ; and in gnome-terminal (which I
rarely use) v:termresponse is ^[[>1;5002;0c ("xterm version 5002", no
kidding) and Vim, seeing that, sets ttymouse=sgr with no user
intervention (even if started with -u DEFAULTS).

Best regards,
Tony.

aro...@vex.net

unread,
Mar 17, 2020, 1:59:51 PM3/17/20
to vim...@googlegroups.com

> Punch 80 times octal 07777 in binary mode in each of them, throw away
> the cards but keep the confetti, and use them ne next time weddings
> will be permitted.
>
>

Seriously, don't do that. Punched card chads are sharp and hard enough to
cause eye injuries.


Reply all
Reply to author
Forward
0 new messages