Mouse scroll in vim like iTerm2 and Konsole #13080

Closed
opened 2026-01-31 03:33:16 +00:00 by claunia · 4 comments
Owner

Originally created by @myy1966 on GitHub (Mar 18, 2021).

Description of the new feature/enhancement

The mouse scroll in the windows terminal when using vim is different from iTerm2 and Konsole. After "set mouse=a" in vim, when scrolling down, the cursor will stay on the sixth line. But in iTerm2 or Konsole, the cursor will stay on the first line.

Scrolling behavior in windows terminal with WSL2:
wt-wsl-vim

Scrolling behavior in iterm2 with MacOS:
iterm2-vim

And in iTerm2, there is a setting to send the arrow keys when in alternate mode. When setting this to yes, Without "set mouse=a" in vim, scroll the wheel can move the arrow and screen. Konsole has a similar function.

iterm2-vim-alternate

Proposed technical implementation details (optional)

  1. Change the cursor position to the first line and last line when scrolling down and up, respectively.
  2. Add a setting to send the arrow keys when in application link vim.

Software Version

Windows Terminal: 1.6.10571.0
WSL2: Ubuntu 18.04
iTerm2: 3.2.5
Konsole: 19.12.3

Originally created by @myy1966 on GitHub (Mar 18, 2021). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> # Description of the new feature/enhancement The mouse scroll in the windows terminal when using vim is different from iTerm2 and Konsole. After "set mouse=a" in vim, when scrolling down, the cursor will stay on the sixth line. But in iTerm2 or Konsole, the cursor will stay on the first line. Scrolling behavior in windows terminal with WSL2: ![wt-wsl-vim](https://user-images.githubusercontent.com/10590090/111601946-d6862500-880d-11eb-9954-ac9150d6eb13.gif) Scrolling behavior in iterm2 with MacOS: ![iterm2-vim](https://user-images.githubusercontent.com/10590090/111602062-f3baf380-880d-11eb-9865-57f32b65b1b0.gif) And in iTerm2, there is a setting to send the arrow keys when in alternate mode. When setting this to yes, Without "set mouse=a" in vim, scroll the wheel can move the arrow and screen. Konsole has a similar function. ![iterm2-vim-alternate](https://user-images.githubusercontent.com/10590090/111602562-6d52e180-880e-11eb-90a8-8a4cbf152f6b.gif) # Proposed technical implementation details (optional) 1. Change the cursor position to the first line and last line when scrolling down and up, respectively. 2. Add a setting to send the arrow keys when in application link vim. # Software Version Windows Terminal: 1.6.10571.0 WSL2: Ubuntu 18.04 iTerm2: 3.2.5 Konsole: 19.12.3
claunia added the Issue-FeatureResolution-Duplicate labels 2026-01-31 03:33:16 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Mar 18, 2021):

I'm pretty sure this will work when the Terminal fully supports the alternate buffer - check out #381 for more info

/dup #381

@zadjii-msft commented on GitHub (Mar 18, 2021): I'm pretty sure this will work when the Terminal fully supports the alternate buffer - check out #381 for more info /dup #381
Author
Owner

@ghost commented on GitHub (Mar 18, 2021):

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@ghost commented on GitHub (Mar 18, 2021): Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!
Author
Owner

@j4james commented on GitHub (Mar 18, 2021):

See also #3321.

@j4james commented on GitHub (Mar 18, 2021): See also #3321.
Author
Owner

@myy1966 commented on GitHub (Mar 18, 2021):

I'm pretty sure this will work when the Terminal fully supports the alternate buffer - check out #381 for more info

/dup #381

Yes, I know the wheel scroll can use in vim, but I found the behavior is slightly different from iTerm2 and Konsole. When I scroll down or scroll up, the cursor position is different. The iTerm2 and Konsole will make the cursor stay on the first and the last line, but the windows terminal makes the cursor stay on the sixth line.

After changing vim to neovim, I got exactly the same behavior with iTerm2 and Konsole.

My second suggestion is the same as #3321.

@myy1966 commented on GitHub (Mar 18, 2021): > I'm pretty sure this will work when the Terminal fully supports the alternate buffer - check out #381 for more info > > /dup #381 ~~Yes, I know the wheel scroll can use in vim, but I found the behavior is slightly different from iTerm2 and Konsole. When I scroll down or scroll up, the cursor position is different. The iTerm2 and Konsole will make the cursor stay on the first and the last line, but the windows terminal makes the cursor stay on the sixth line.~~ After changing vim to neovim, I got exactly the same behavior with iTerm2 and Konsole. My second suggestion is the same as #3321.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#13080