ViM mousing only partially works, works different across different platforms #14100

Open
opened 2026-01-31 04:00:54 +00:00 by claunia · 23 comments
Owner

Originally created by @erichiller on GitHub (Jun 3, 2021).

Originally assigned to: @DHowett on GitHub.

Windows Terminal version (or Windows build number)

1.9.1445.0

Other Software

Software Version
Windows Terminal 1.9.1445.0
PowerShell 7.1.1
ViM (Windows) 8.2 patches 1-2920
ViM (Git) 8.2 patches 1-2859
ViM (WSL) 8.1 patches 1-875
ViM (Remote) 8.1 patches 1-2269
OpenSSH 8.5p1

This is the newest ViM from the vim for windows github

Steps to reproduce

Install WT (Windows Terminal), ViM, Git, WSL for testing (see combinations tested below)
Create vimrc-test file with the contents:
set mouse=a

Run command with vim -u vimrc-test textfile where textfile is some file that is long enough to have room to scroll.

Expected Behavior

Clicking, Selecting, Scrolling to work across all Windows Terminal combinations (except for cmd.exe, I don't expect that)

Actual Behavior

Is scrolling supposed to work at this point? I've tested a number of options, and my findings are currently:

# Console Selection Click Scrolling Note
1 WT + WSL (Debian)
2 WT + PowerShell + Windows ViM
3 WT + PowerShell + Git ViM
4 WT + PowerShell + Remote ViM
5 WT + PowerShell + Windows ViM this is a duplicate of the above
6 WT + cmd + Windows ViM
7 WT + cmd + Git ViM
8 pwsh + PowerShell + Git ViM
9 pwsh + PowerShell + Remote Vim

By remote ViM I mean using ViM over an ssh connection to a linux machine.

Referencing #376

Originally created by @erichiller on GitHub (Jun 3, 2021). Originally assigned to: @DHowett on GitHub. ### Windows Terminal version (or Windows build number) 1.9.1445.0 ### Other Software Software | Version ---------------------|------------------ Windows Terminal | 1.9.1445.0 PowerShell | 7.1.1 ViM (Windows) | 8.2 patches 1-2920 ViM (Git) | 8.2 patches 1-2859 ViM (WSL) | 8.1 patches 1-875 ViM (Remote) | 8.1 patches 1-2269 OpenSSH | 8.5p1 This is the newest ViM from the vim for windows github ### Steps to reproduce Install WT (Windows Terminal), ViM, Git, WSL for testing (see combinations tested below) Create `vimrc-test` file with the contents: set mouse=a Run command with `vim -u vimrc-test textfile` where `textfile` is some file that is long enough to have room to scroll. ### Expected Behavior Clicking, Selecting, Scrolling to work across all Windows Terminal combinations (except for `cmd.exe`, I don't expect that) ### Actual Behavior Is scrolling supposed to work at this point? I've tested a number of options, and my findings are currently: `#` | Console | Selection | Click | Scrolling | Note ---|------ |------- |----- | ---------|-------- 1 | WT + WSL (Debian) | ✔ | ✔ | ✔ | 2 | WT + PowerShell + Windows ViM | ✔ | ✔ | ❌ | 3 | WT + PowerShell + Git ViM | ❌ | ❌ | ❌ | 4 | WT + PowerShell + Remote ViM | ❌ | ❌ | ❌ | 5 | ~WT + PowerShell + Windows ViM~ | ~✔~ | ~✔~ | ~❌~ | _this is a duplicate of the above_ 6 | WT + cmd + Windows ViM | ✔ | ✔ | ❌ | 7 | WT + cmd + Git ViM | ❌ | ❌ | ❌ | 8 | pwsh + PowerShell + Git ViM | ✔ | ✔ | ✔ | 9 | pwsh + PowerShell + Remote Vim | ✔ | ✔ | ✔ | By remote ViM I mean using ViM over an ssh connection to a linux machine. Referencing #376
Author
Owner

@DHowett commented on GitHub (Jun 3, 2021):

I'm surprised at a bunch of these, actually. This is my understanding of how it should work, given some constraints:

EXPECTED

Console Selection Click Scrolling Note
[1] WT + WSL (Debian) Terminal v0.9, this was #545
[2] WT + PowerShell + Windows ViM Surprised scrolling doesn't work after 8.2 p 2913
[3] WT + PowerShell + Git ViM Patch 2913 is required
[4] WT + PowerShell + Remote ViM Patch 2913 is required
[5] WT + PowerShell + Windows ViM Duplicate of 2?
[6] WT + cmd + Windows ViM This should be identical to 2
[7] WT + cmd + Git ViM This should be identical to 3
[8] pwsh + PowerShell + Git ViM Longstanding mouse support in conhost 😄
[9] pwsh + PowerShell + Remote Vim As in 8

I'll work on figuring out what's actually going on here...

Are you using ssh from within WSL or from Windows (ssh.exe)?

@DHowett commented on GitHub (Jun 3, 2021): I'm surprised at a bunch of these, actually. This is my understanding of how it _should_ work, given some constraints: ### EXPECTED Console | Selection | Click | Scrolling | Note ------ |------- |----- | ---------|-------- [1] WT + WSL (Debian) | ✔ | ✔ | ✔ | Terminal v0.9, this was #545 [2] WT + PowerShell + Windows ViM | ✔ | ✔ | ✔ | Surprised scrolling doesn't work after 8.2 p 2913 [3] WT + PowerShell + Git ViM | ❌ | ❌ | ❌ | Patch 2913 is required [4] WT + PowerShell + Remote ViM | ❌ | ❌ | ❌ | Patch 2913 is required [5] WT + PowerShell + Windows ViM | ✔ | ✔ | ✔ | Duplicate of 2? [6] WT + cmd + Windows ViM | ✔ | ✔ | ✔ | This should be identical to 2 [7] WT + cmd + Git ViM | ✔ | ✔ | ✔ | This should be identical to 3 [8] pwsh + PowerShell + Git ViM | ✔ | ✔ | ✔ | Longstanding mouse support in conhost :smile: [9] pwsh + PowerShell + Remote Vim | ✔ | ✔ | ✔ | As in 8 I'll work on figuring out what's actually going on here... Are you using ssh from within WSL or from Windows (ssh.exe)?
Author
Owner

@skyline75489 commented on GitHub (Jun 4, 2021):

I can confirm that with 8.2 patches 1-2932 I can only see selection & click works, but not scrolling.

Link to patch 2913 6ef5ab5904

@skyline75489 commented on GitHub (Jun 4, 2021): I can confirm that with 8.2 patches 1-2932 I can only see selection & click works, but not scrolling. Link to patch 2913 https://github.com/vim/vim/commit/6ef5ab59043681a51e8ca2ab0a1e4ff8f0f4bb47
Author
Owner

@erichiller commented on GitHub (Jun 4, 2021):

@DHowett The ssh I'm using is from git @ C:\Program Files\Git\usr\bin\ssh.exe
You are correct on Number 5, I numbered mine and crossed 5 out as duplicate for ease of reading.

Also, I am not sure what happened with my test before using cmd, (Number 6) but it does behave the same as Number 2. Meaning, Selection & Clicking work, but not Scrolling. I updated my initial table to reflect the changes.

@erichiller commented on GitHub (Jun 4, 2021): @DHowett The ssh I'm using is from git @ `C:\Program Files\Git\usr\bin\ssh.exe` You are correct on Number 5, I numbered mine and crossed 5 out as duplicate for ease of reading. Also, I am not sure what happened with my test before using cmd, (Number 6) but it does behave the same as Number 2. Meaning, Selection & Clicking work, but not Scrolling. I updated my initial table to reflect the changes.
Author
Owner

@DHowett commented on GitHub (Jun 4, 2021):

ALRIGHT! I think I've cracked it. Here's my updated table...

Console Selection Click Scrolling Note
[1] WT + WSL (Debian) Terminal v0.9, this was #545
[2] WT + PowerShell + Windows ViM Surprised scrolling doesn't work after 8.2 p 2913, see note 2
[3] WT + PowerShell + Git ViM Patch 2913 is required
[4] WT + PowerShell + Remote ViM Patch 2913 is required
[5] WT + PowerShell + Windows ViM Duplicate of 2?
[6] WT + cmd + Windows ViM This should be identical to 2
[7] WT + cmd + Git ViM This should be identical to 3
[8] pwsh + PowerShell + Git ViM Longstanding mouse support in conhost 😄, see note 2
[9] pwsh + PowerShell + Remote Vim As in 8, see note 3

Notes

  1. When Vim detects that it is running on Windows, it uses Windows mouse events and Windows console events. Running in Cygwin/MSYS2 can add another layer of complexity here, as the existence of mouse events depends on $TERM and the Cygwin runtime version (only 3.1+ support "let the windows console control how input is generated")

  2. I can find no mention of scrolling in vim's Windows code (the "MOUSE_WHEELED" event flag). I also can't get it to scroll outside of Terminal (!)

  3. Depends on what you're remoting to! If Linux, you're hitting the well-tested Linux remoting code. If you're using a Cygwin SSH client, see note 1 (!)

@DHowett commented on GitHub (Jun 4, 2021): ALRIGHT! I think I've cracked it. Here's my updated table... Console | Selection | Click | Scrolling | Note ------ |------- |----- | ---------|-------- [1] WT + WSL (Debian) | ✔ | ✔ | ✔ | Terminal v0.9, this was #545 [2] WT + PowerShell + Windows ViM | ✔ | ✔ | ❌ | Surprised scrolling doesn't work after 8.2 p 2913, see note 2 [3] WT + PowerShell + Git ViM | ❌ | ❌ | ❌ | Patch 2913 is required [4] WT + PowerShell + Remote ViM | ❌ | ❌ | ❌ | Patch 2913 is required [5] WT + PowerShell + Windows ViM | ✔ | ✔ | ✔ | Duplicate of 2? [6] ~WT + cmd + Windows ViM~ | ~✔~ | ~✔~ | ~❌~ | ~This should be identical to 2~ [7] WT + cmd + Git ViM | ❌ | ❌ | ❌ | This should be identical to 3 [8] pwsh + PowerShell + Git ViM | ✔ | ✔ | ❌ | Longstanding mouse support in conhost :smile:, see note 2 [9] pwsh + PowerShell + Remote Vim | ✔ | ✔ | ❌ | As in 8, see note 3 Notes 1. When Vim detects that it is running on Windows, it uses Windows mouse events and Windows console events. Running in Cygwin/MSYS2 can add another layer of complexity here, as the existence of mouse events depends on `$TERM` and the Cygwin runtime version (only 3.1+ support "let the windows console control how input is generated") 2. I can find no mention of scrolling in vim's Windows code (the "`MOUSE_WHEELED`" event flag). I also can't get it to scroll _outside_ of Terminal (!) 3. Depends on what you're remoting to! If Linux, you're hitting the well-tested Linux remoting code. If you're using a Cygwin SSH client, see note 1 (!)
Author
Owner

@jclark42796 commented on GitHub (Sep 2, 2021):

On Win10, having a similar issue where mouse scroll up works but mouse scroll down does not. Using putty to ssh to a Linux 2 server to edit with vim 8.1 (included patches 1-1602). Same putty client with vim 8.0 (patches 1-503, 1365) does not have this issue.

@jclark42796 commented on GitHub (Sep 2, 2021): On Win10, having a similar issue where mouse scroll up works but mouse scroll down does not. Using putty to ssh to a Linux 2 server to edit with vim 8.1 (included patches 1-1602). Same putty client with vim 8.0 (patches 1-503, 1365) does not have this issue.
Author
Owner

@silverqx commented on GitHub (Sep 25, 2021):

I want to ask, should scrolling work for pure vim on windows in windows terminal? For me, it does not.

WinTerm - 1.11.2421
Vim - 8.2.3452

It only works if I ssh to my Gentoo virtual machine and run vim there (from the WinTerm or from the cmd terminal) and it also works when I start vim from MSYS2 mingw64.

Left-click works for me in all the above-described environments.

I have tried different settings, --clean param, and also tried to disable QuickEdit Mode.
Scrolling does not work also in the cmd and PowerShell terminals.

@silverqx commented on GitHub (Sep 25, 2021): I want to ask, should scrolling work for pure vim on windows in windows terminal? For me, it does not. WinTerm - 1.11.2421 Vim - 8.2.3452 It only works if I ssh to my Gentoo virtual machine and run vim there (from the WinTerm or from the cmd terminal) and it also works when I start vim from MSYS2 mingw64. Left-click works for me in all the above-described environments. I have tried different settings, `--clean` param, and also tried to disable QuickEdit Mode. Scrolling does not work also in the cmd and PowerShell terminals.
Author
Owner

@silverqx commented on GitHub (Oct 11, 2021):

Now I have tried neovim and scrolling is working like expected, it looks like a bug in the vim itself.

@silverqx commented on GitHub (Oct 11, 2021): Now I have tried neovim and scrolling is working like expected, it looks like a bug in the vim itself.
Author
Owner

@xaljer commented on GitHub (Oct 20, 2021):

I use Neovim over an ssh connection to a linux machine, scrolling and clicking are not work.

@xaljer commented on GitHub (Oct 20, 2021): I use Neovim over an ssh connection to a linux machine, scrolling and clicking are not work.
Author
Owner

@xaljer commented on GitHub (Dec 18, 2021):

@DHowett hi, what do you mean by "Patch 2913 is required"?

@xaljer commented on GitHub (Dec 18, 2021): @DHowett hi, what do you mean by "Patch 2913 is required"?
Author
Owner

@DHowett commented on GitHub (Dec 18, 2021):

@DHowett hi, what do you mean by "Patch 2913 is required"?

If you are using Vim 8.1 or 8.2, you need to have a patch version greater than or equal to 2913.

@DHowett commented on GitHub (Dec 18, 2021): > @DHowett hi, what do you mean by "Patch 2913 is required"? If you are using Vim 8.1 or 8.2, you need to have a patch version greater than or equal to 2913.
Author
Owner

@xaljer commented on GitHub (Dec 18, 2021):

https://github.com/neovim/neovim/pull/14328
It looks like neovim already have this patch? I use neovim over SSH, mouse does not work.

@xaljer commented on GitHub (Dec 18, 2021): https://github.com/neovim/neovim/pull/14328 It looks like neovim already have this patch? I use neovim over SSH, mouse does not work.
Author
Owner

@DHowett commented on GitHub (Dec 18, 2021):

I am not sure about the mapping of neovim versions to vim versions. My advice applies only vim. The neovim maintainers will need to accept a similar patch.

@DHowett commented on GitHub (Dec 18, 2021): I am not sure about the mapping of neovim versions to vim versions. My advice applies only _vim_. The neovim maintainers will need to accept a similar patch.
Author
Owner

@xaljer commented on GitHub (Dec 19, 2021):

I use neovim over SSH in https://github.com/Eugeny/tabby, mouse actions work fine. So I think it's not neovim's issue.

@xaljer commented on GitHub (Dec 19, 2021): I use neovim over SSH in https://github.com/Eugeny/tabby, mouse actions work fine. So I think it's not neovim's issue.
Author
Owner

@DHowett commented on GitHub (Dec 19, 2021):

I use neovim over SSH in https://github.com/Eugeny/tabby, mouse actions work fine. So I think it's not neovim's issue.

Please file a separate issue! This one is specific to traditional vim :)

@DHowett commented on GitHub (Dec 19, 2021): > I use neovim over SSH in https://github.com/Eugeny/tabby, mouse actions work fine. So I think it's not neovim's issue. Please file a separate issue! This one is specific to traditional vim :)
Author
Owner

@zewpo commented on GitHub (Oct 15, 2022):

This is caused by the Vim compiled for windows consoles, the source code does not have mouse scroll handling in windows consoles. I had a go, and it was simple to add it, so I have just developed a pull request for vim. https://github.com/vim/vim/pull/11374

@zewpo commented on GitHub (Oct 15, 2022): This is caused by the Vim compiled for windows consoles, the source code does not have mouse scroll handling in windows consoles. I had a go, and it was simple to add it, so I have just developed a pull request for vim. https://github.com/vim/vim/pull/11374
Author
Owner

@DHowett commented on GitHub (Oct 17, 2022):

This is caused by the Vim compiled for windows consoles, the source code does not have mouse scroll handling in windows consoles. I had a go, and it was simple to add it, so I have just developed a pull request for vim. vim/vim#11374

watching with rapt attention!

Thanks for doing this!

@DHowett commented on GitHub (Oct 17, 2022): > This is caused by the Vim compiled for windows consoles, the source code does not have mouse scroll handling in windows consoles. I had a go, and it was simple to add it, so I have just developed a pull request for vim. [vim/vim#11374](https://github.com/vim/vim/pull/11374) _watching with rapt attention!_ Thanks for doing this!
Author
Owner

@zewpo commented on GitHub (Oct 21, 2022):

Can help me by testing the new windows console mouse scroll event handling now in Vim 9, from at least Patch 9.0.0812. I did a few submissions and patches, I've only been manually testing it myself so far. Feedback is very welcome.

@zewpo commented on GitHub (Oct 21, 2022): Can help me by testing the new windows console mouse scroll event handling now in Vim 9, from at least Patch 9.0.0812. I did a few submissions and patches, I've only been manually testing it myself so far. Feedback is very welcome.
Author
Owner

@silverqx commented on GitHub (Oct 23, 2022):

Omg, many thx @zewpo, we can finally scroll in vim on Windows 🙌🤙, I had tried to create a similar patch like this, and I created a scrolling handler in src/os_win32.c and was able to scroll the vim screen buffer up/down but in a hacky way, it was too much for me and I failed because I didn't know how to scroll the vim buffer correctly, exactly I didn't know how or what I should write to the vim stream buffer to scroll correctly.

But your PR works perfectly and I'm so grateful for this 🙏I have installed vim 9.0.801 and it just scrolls up/down without problems.

@silverqx commented on GitHub (Oct 23, 2022): Omg, many thx @zewpo, we can finally scroll in vim on Windows 🙌🤙, I had tried to create a similar patch like this, and I created a scrolling handler in `src/os_win32.c` and was able to scroll the vim screen buffer up/down but in a hacky way, it was too much for me and I failed because I didn't know how to scroll the vim buffer correctly, exactly I didn't know how or what I should write to the vim stream buffer to scroll correctly. But your PR works perfectly and I'm so grateful for this 🙏I have installed `vim 9.0.801` and it just scrolls up/down without problems.
Author
Owner

@BDisp commented on GitHub (Oct 29, 2022):

I'm also facing this issue where the mouse only partially work by open a WSL 2 distro in the Windows Terminal. I'm not using VIM but the https://github.com/gui-cs/Terminal.Gui. On a full screen only the left half of the columns responds to mouse events and right don't. Before the mouse wasn't working on Windows (with PowerShell or CMD) and worked well with WSL 2. Now the mouse works well on Windows on all columns and the WSL 2 only works on the left half side of a full screen. Is there any intention to fix this, please?

@BDisp commented on GitHub (Oct 29, 2022): I'm also facing this issue where the mouse only partially work by open a `WSL 2` distro in the `Windows Terminal`. I'm not using VIM but the https://github.com/gui-cs/Terminal.Gui. On a full screen only the left half of the columns responds to mouse events and right don't. Before the mouse wasn't working on `Windows` (with `PowerShell` or `CMD`) and worked well with `WSL 2`. Now the mouse works well on `Windows` on all columns and the `WSL 2` only works on the left half side of a full screen. Is there any intention to fix this, please?
Author
Owner

@DHowett commented on GitHub (Oct 29, 2022):

@BDisp thanks for reporting! Just a couple notes:

  1. This issue is specific to vim; if you're having another issue with a non-vim application it would be best to track it in a separate issue.
  2. The problem you are seeing is a well-known limitation of "X11" mouse reporting, where the X and Y coordinates are limited to about 93 (or 97? Roughly half of a screen on most displays.). Terminal.Gui should be requesting the much newer and much more flexible "SGR" mouse reporting, which has no practical limit on coordinate values. You will need to make a feature request to Terminal.Gui.

I'm going to mark this comment and the preceding one as "off topic" since they aren't specific to Vim.

Thanks!

@DHowett commented on GitHub (Oct 29, 2022): @BDisp thanks for reporting! Just a couple notes: 1. This issue is specific to vim; if you're having another issue with a non-vim application it would be best to track it in a separate issue. 2. The problem you are seeing is a well-known limitation of "X11" mouse reporting, where the X and Y coordinates are limited to about 93 (or 97? Roughly half of a screen on most displays.). `Terminal.Gui` should be requesting the much newer and much more flexible "SGR" mouse reporting, which has no practical limit on coordinate values. You will need to make a feature request to `Terminal.Gui`. I'm going to mark this comment and the preceding one as "off topic" since they aren't specific to Vim. Thanks!
Author
Owner

@ben-foxmoore commented on GitHub (Nov 22, 2022):

I have the same issue as @BDisp but specifically in ViM.

I'm using Microsoft Terminal with WSL2 (ArchLinux) and ViM 9.0. Text selection/interaction and scrolling is only working on the left half of the terminal (in my case, it seems to work for the first 95 characters). This issue is only present inside of ViM - when at the prompt, I can select text and scroll regardless of where the cursor/mouse is.

@DHowett You mentioned "SGR" reporting in your comment - I noticed that ViM lists this in the included features when using :version:

VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Oct 22 2022 19:58:44)
Included patches: 1-813
Compiled by Arch Linux
Huge version without GUI.  Features included (+) or not (-):
+acl               -clientserver      +diff              +folding           +langmap           +mouse_dec         +num64             +reltime           +syntax            +title             +wildmenu
+arabic            -clipboard         +digraphs          -footer            +libcall           +mouse_gpm         +packages          +rightleft         +tag_binary        -toolbar           +windows
+autocmd           +cmdline_compl     -dnd               +fork()            +linebreak         -mouse_jsbterm     +path_extra        +ruby/dyn          -tag_old_static    +user_commands     +writebackup
+autochdir         +cmdline_hist      -ebcdic            +gettext           +lispindent        +mouse_netterm     +perl/dyn          +scrollbind        -tag_any_white     +vartabs           -X11
-autoservername    +cmdline_info      +emacs_tags        -hangul_input      +listcmds          +mouse_sgr         +persistent_undo   +signs             +tcl/dyn           +vertsplit         -xfontset
-balloon_eval      +comments          +eval              +iconv             +localmap          -mouse_sysmouse    +popupwin          +smartindent       +termguicolors     +vim9script        -xim
+balloon_eval_term +conceal           +ex_extra          +insert_expand     +lua/dyn           +mouse_urxvt       +postscript        -sodium            +terminal          +viminfo           -xpm
-browse            +cryptv            +extra_search      +ipv6              +menu              +mouse_xterm       +printer           -sound             +terminfo          +virtualedit       -xsmp
++builtin_terms    +cscope            -farsi             +job               +mksession         +multi_byte        +profile           +spell             +termresponse      +visual            -xterm_clipboard
+byte_offset       +cursorbind        +file_in_path      +jumplist          +modify_fname      +multi_lang        -python            +startuptime       +textobjects       +visualextra       -xterm_save
+channel           +cursorshape       +find_in_path      +keymap            +mouse             -mzscheme          +python3/dyn       +statusline        +textprop          +vreplace
+cindent           +dialog_con        +float             +lambda            -mouseshape        +netbeans_intg     +quickfix          -sun_workshop      +timers            +wildignore
   system vimrc file: "/etc/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build/vim/src=/usr/src/debug -flto=auto -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -L. -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -fstack-protector-strong -rdynamic -Wl,-export-dynamic -Wl,--no-as-needed -Wl,-E -Wl,-rpath,/usr/lib/perl5/5.36/core_perl/CORE -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -flto=auto -L/usr/local/lib -o vim -lm -ltinfo -lelf -lacl -lattr -lgpm -Wl,-E -Wl,-rpath,/usr/lib/perl5/5.36/core_perl/CORE -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -flto -fstack-protector-strong -L/usr/local/lib -L/usr/lib/perl5/5.36/core_perl/CORE -lperl -lpthread -ldl -lm -lcrypt -lutil -lc -L/usr/lib -ltclstub8.6 -ldl -lz -lpthread -lm

Is there any way I can test if this mode is being requested and used properly by ViM?

@ben-foxmoore commented on GitHub (Nov 22, 2022): I have the same issue as @BDisp but specifically in ViM. I'm using Microsoft Terminal with WSL2 (ArchLinux) and ViM 9.0. Text selection/interaction and scrolling is only working on the left half of the terminal (in my case, it seems to work for the first 95 characters). This issue is only present inside of ViM - when at the prompt, I can select text and scroll regardless of where the cursor/mouse is. @DHowett You mentioned "SGR" reporting in your comment - I noticed that ViM lists this in the included features when using `:version`: ``` VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Oct 22 2022 19:58:44) Included patches: 1-813 Compiled by Arch Linux Huge version without GUI. Features included (+) or not (-): +acl -clientserver +diff +folding +langmap +mouse_dec +num64 +reltime +syntax +title +wildmenu +arabic -clipboard +digraphs -footer +libcall +mouse_gpm +packages +rightleft +tag_binary -toolbar +windows +autocmd +cmdline_compl -dnd +fork() +linebreak -mouse_jsbterm +path_extra +ruby/dyn -tag_old_static +user_commands +writebackup +autochdir +cmdline_hist -ebcdic +gettext +lispindent +mouse_netterm +perl/dyn +scrollbind -tag_any_white +vartabs -X11 -autoservername +cmdline_info +emacs_tags -hangul_input +listcmds +mouse_sgr +persistent_undo +signs +tcl/dyn +vertsplit -xfontset -balloon_eval +comments +eval +iconv +localmap -mouse_sysmouse +popupwin +smartindent +termguicolors +vim9script -xim +balloon_eval_term +conceal +ex_extra +insert_expand +lua/dyn +mouse_urxvt +postscript -sodium +terminal +viminfo -xpm -browse +cryptv +extra_search +ipv6 +menu +mouse_xterm +printer -sound +terminfo +virtualedit -xsmp ++builtin_terms +cscope -farsi +job +mksession +multi_byte +profile +spell +termresponse +visual -xterm_clipboard +byte_offset +cursorbind +file_in_path +jumplist +modify_fname +multi_lang -python +startuptime +textobjects +visualextra -xterm_save +channel +cursorshape +find_in_path +keymap +mouse -mzscheme +python3/dyn +statusline +textprop +vreplace +cindent +dialog_con +float +lambda -mouseshape +netbeans_intg +quickfix -sun_workshop +timers +wildignore system vimrc file: "/etc/vimrc" user vimrc file: "$HOME/.vimrc" 2nd user vimrc file: "~/.vim/vimrc" user exrc file: "$HOME/.exrc" defaults file: "$VIMRUNTIME/defaults.vim" fall-back for $VIM: "/usr/share/vim" Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build/vim/src=/usr/src/debug -flto=auto -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 Linking: gcc -L. -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -fstack-protector-strong -rdynamic -Wl,-export-dynamic -Wl,--no-as-needed -Wl,-E -Wl,-rpath,/usr/lib/perl5/5.36/core_perl/CORE -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -flto=auto -L/usr/local/lib -o vim -lm -ltinfo -lelf -lacl -lattr -lgpm -Wl,-E -Wl,-rpath,/usr/lib/perl5/5.36/core_perl/CORE -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -flto -fstack-protector-strong -L/usr/local/lib -L/usr/lib/perl5/5.36/core_perl/CORE -lperl -lpthread -ldl -lm -lcrypt -lutil -lc -L/usr/lib -ltclstub8.6 -ldl -lz -lpthread -lm ``` Is there any way I can test if this mode is being requested and used properly by ViM?
Author
Owner

@DHowett commented on GitHub (Nov 22, 2022):

Is there any way I can test if this mode is being requested and used properly by ViM?

Honestly, I'm not sure how to tell whether it's using it properly... but I think that we can figure out whether it's requesting it with :set ttymouse (or :set ttym). If it reports anything other than ttymouse=sgr, it's not requesting it.

Whether it does that automatically is probably based on a number of things like $TERM and the terminfo. In any case, it can be overridden with :set ttym=sgr!

@DHowett commented on GitHub (Nov 22, 2022): > Is there any way I can test if this mode is being requested and used properly by ViM? Honestly, I'm not sure how to tell whether it's _using_ it properly... but I think that we can figure out whether it's _requesting_ it with `:set ttymouse` (or `:set ttym`). If it reports anything other than `ttymouse=sgr`, it's not requesting it. Whether it does that automatically is probably based on a number of things like `$TERM` and the `terminfo`. In any case, it can be overridden with `:set ttym=sgr`!
Author
Owner

@ben-foxmoore commented on GitHub (Nov 22, 2022):

Aha! ViM isn't requesting it:

:set ttym
ttymouse=xterm

Forcing it using :set ttym=sgr completely fixes the problem - thanks for that! I'll try to investigate why ViM isn't requesting it by default (in my setup/configuration).

@ben-foxmoore commented on GitHub (Nov 22, 2022): Aha! ViM isn't requesting it: ``` :set ttym ttymouse=xterm ``` Forcing it using `:set ttym=sgr` completely fixes the problem - thanks for that! I'll try to investigate why ViM isn't requesting it by default (in my setup/configuration).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#14100