Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug? mintty + vim w/ mouse=a #782

Closed
keighrim opened this issue Jul 7, 2018 · 6 comments
Closed

Bug? mintty + vim w/ mouse=a #782

keighrim opened this issue Jul 7, 2018 · 6 comments

Comments

@keighrim
Copy link

keighrim commented Jul 7, 2018

I'm using terminal vim with mintty as the terminal emulator (msys is my main bash for Windows). When I move the window focus by a mouse click to mintty running vim (from any other app), in additional to the focus moving to the mintty window, vim scrolls three lines up (I think it's doing literally "3<c-y>"), instead of moving cursor to where I clicked in the buffer. However, when I'm running vim inside tmux, only the focus moves and nothing else happen.
I went through my vimrc and found that mouse=X (a, n, v any option) is causing this.
Is this some kind of bug in mintty?

(The same happens when I'm ssh-ing to OSX or linux machines using mintty + openssh)

@mintty
Copy link
Owner

mintty commented Jul 8, 2018

Reproducible wth :set mouse=a or n, not v.
After kill -9, we can observe what mouse mode is actually activated and it's different from the one vim uses in xterm. Mouse escape sequences sent are correct, my suspicion is that vim lost the capability to interpret the older mouse mode correctly. Maybe it has an option to enforce using a newer mouse mode?
Please report as a bug to vim.

@mintty
Copy link
Owner

mintty commented Jul 8, 2018

Hold on; it looks as if a mouse release event is sent initially when focussing the window. This might be confusing vim, further analysis needed.

@mintty
Copy link
Owner

mintty commented Jul 8, 2018

Mintty 2.8.2 introduced a new feature to prevent accidental text selection on mouse-click window activation (#717) by suppressing the first mouse event after focussing a window. However, it fails to suppress the mouse release event too. While this is subject to improvement, vim should not interpret a singular mouse release event as a scroll-down action.

mintty added a commit that referenced this issue Jul 9, 2018
mintty added a commit that referenced this issue Sep 12, 2018
@mintty
Copy link
Owner

mintty commented Sep 20, 2018

Released 2.9.1.

@mintty mintty closed this as completed Sep 20, 2018
@ahsanu123
Copy link

hey, iam newbie about nvim and mintty.
it this issus fix? how i setting mintty/neovim so i can enable mouse functionality??

i try to enable mouse function on neovim, but not working. please help.
thanks.

@mintty
Copy link
Owner

mintty commented Jul 25, 2023

The issue above was fixed with 2.9.1.
I am not a vim user myself but I once set up a .vimrc file which looks like this:

set mouse=a
if has("mouse_sgr")
    set ttymouse=sgr
else
    set ttymouse=xterm2
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants