VIM Screen Corruption #17868

Open
opened 2026-01-31 05:56:50 +00:00 by claunia · 0 comments
Owner

Originally created by @EnGamma on GitHub (Jul 6, 2022).

Windows Terminal version

1.13.11431.0

Windows build number

10.0.19043.1766

Other Software

vim 8.2 in Windows Terminal WSL (both Ubuntu and Debian variants)

Debian:
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Oct 01 2021 01:51:08)
Included patches: 1-2434
Extra patches: 8.2.3402, 8.2.3403, 8.2.3409, 8.2.3428

Ubuntu:
VIM - Vi IMproved 8.1 (2018 May 18, compiled Feb 01 2022 09:16:32)
Included patches: 1-2269, 3612, 3625, 3669, 3741

vimrc.txt

Steps to reproduce

Start VIM, look to bottom of screen, see that the tail of the VIM status bar text is wrapped to the next screen line.

Alternatively, have VIM open a new file or a file of only a few lines that will not fill the screen vertically with lines. The normally line-leading tildes ~ are scattered across the screen instead of at the left edge [note that this happens only in a non-full-screen window. In full screen it appears normal.]

vim_newfile
.

Expected Behavior

Windows Terminal => VIM screen width communicated reliably at startup, no wrapping of status bar, no further corruption as scrolling causes more of the wrapped text to fill bottom of screen, no misalignment of visible line text with underlying line #.

Actual Behavior

I'm seeing screen corruption with VIM in Windows Terminal (WT) immediately upon startup of VIM and am NOT using tmux. I've determined that it has something to do with VIM not getting the proper screen width from WT. The most obvious indicator that this is happening is that the tail end of the VIM status bar get's wrapped to an added screen line. For example, the tail end of the status bar might indicate the cursor is on line 141, column 1, 74% through the file with this at the tail end: "141,1 74%". What happens is "41,1 74%" gets wrapped to a new line on the screen. Any scrolling causes more wrapping lines to appear at the bottom of the WT window.

Also, if editing a file of only a few lines, VIM fills the screen below with lines starting with a tilde ~. If you open such a file, the ~ are scattered across the screen.

The corruption seems to persist even after exiting back to shell prompt (i.e., the shell prompt is invisible after a ^L and becomes visible again only after pressing [ENTER]).

I've found 2 cumbersome workarounds for now:

Resize the terminal widow or
Toggle full screen [F11] [F11] or [ALT]-{ENTER] [ALT]-[ENTER]
Performance is normal after that.

Originally created by @EnGamma on GitHub (Jul 6, 2022). ### Windows Terminal version 1.13.11431.0 ### Windows build number 10.0.19043.1766 ### Other Software vim 8.2 in Windows Terminal WSL (both Ubuntu and Debian variants) Debian: VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Oct 01 2021 01:51:08) Included patches: 1-2434 Extra patches: 8.2.3402, 8.2.3403, 8.2.3409, 8.2.3428 Ubuntu: VIM - Vi IMproved 8.1 (2018 May 18, compiled Feb 01 2022 09:16:32) Included patches: 1-2269, 3612, 3625, 3669, 3741 [vimrc.txt](https://github.com/microsoft/terminal/files/9056483/vimrc.txt) ### Steps to reproduce Start VIM, look to bottom of screen, see that the tail of the VIM status bar text is wrapped to the next screen line. Alternatively, have VIM open a new file or a file of only a few lines that will not fill the screen vertically with lines. The normally line-leading tildes ~ are scattered across the screen instead of at the left edge [note that this happens only in a non-full-screen window. In full screen it appears normal.] ![vim_newfile](https://user-images.githubusercontent.com/10820881/177599298-7e85e943-2226-421f-afbb-6a165e606863.png) . ### Expected Behavior Windows Terminal => VIM screen width communicated reliably at startup, no wrapping of status bar, no further corruption as scrolling causes more of the wrapped text to fill bottom of screen, no misalignment of visible line text with underlying line #. ### Actual Behavior I'm seeing screen corruption with VIM in Windows Terminal (WT) immediately upon startup of VIM and am NOT using tmux. I've determined that it has something to do with VIM not getting the proper screen width from WT. The most obvious indicator that this is happening is that the tail end of the VIM status bar get's wrapped to an added screen line. For example, the tail end of the status bar might indicate the cursor is on line 141, column 1, 74% through the file with this at the tail end: "141,1 74%". What happens is "41,1 74%" gets wrapped to a new line on the screen. Any scrolling causes more wrapping lines to appear at the bottom of the WT window. Also, if editing a file of only a few lines, VIM fills the screen below with lines starting with a tilde ~. If you open such a file, the ~ are scattered across the screen. The corruption seems to persist even after exiting back to shell prompt (i.e., the shell prompt is invisible after a ^L and becomes visible again only after pressing [ENTER]). I've found 2 cumbersome workarounds for now: Resize the terminal widow or Toggle full screen [F11] [F11] or [ALT]-{ENTER] [ALT]-[ENTER] Performance is normal after that.
claunia added the Help WantedIssue-BugArea-VTResolution-DuplicatePriority-2 labels 2026-01-31 05:56:50 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#17868