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

VIM Screen Corruption #13441

Closed
EnGamma opened this issue Jul 6, 2022 · 6 comments
Closed

VIM Screen Corruption #13441

EnGamma opened this issue Jul 6, 2022 · 6 comments
Labels
Area-VT Virtual Terminal sequence support Help Wanted We encourage anyone to jump in on these. Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-2 A description (P2) Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.

Comments

@EnGamma
Copy link

EnGamma commented 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.

@EnGamma EnGamma added the Issue-Bug It either shouldn't be doing this or needs an investigation. label Jul 6, 2022
@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Jul 6, 2022
@zadjii-msft
Copy link
Member

Wow okay there's like, a LOT going on wrong when I use that vimrc 😨 I'm seeing way worse artifacts than just the screen size being wrong. Hopefully there's just one sequence that's causing all the corruption here.

Interestingly though, I think that opening that vimrr in vim, then exiting, does seemingly resize the conpty buffer. Opening nano after closing vim looks equally crazy:
image

@zadjii-msft zadjii-msft added Help Wanted We encourage anyone to jump in on these. Area-VT Virtual Terminal sequence support Priority-2 A description (P2) labels Jul 7, 2022
@j4james
Copy link
Collaborator

j4james commented Jul 7, 2022

I think the issue here is just that you've configured VIM to request a specific screen size, and Windows Terminal doesn't support that. It looks fine to me if I comment out this line:

set lines=72 columns=269

Unless there is some other problem that I'm missing, this looks to me like a duplicate of #5094.

@zadjii-msft
Copy link
Member

That's exactly it.

/dup #5094

@zadjii-msft zadjii-msft closed this as not planned Won't fix, can't repro, duplicate, stale Jul 7, 2022
@ghost
Copy link

ghost commented Jul 7, 2022

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 ghost closed this as completed Jul 7, 2022
@ghost ghost added Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing. and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Jul 7, 2022
@EnGamma
Copy link
Author

EnGamma commented Jul 7, 2022 via email

@hulucc
Copy link

hulucc commented Jul 21, 2022

if !empty($WT_SESSION)
    ...
 endif

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-VT Virtual Terminal sequence support Help Wanted We encourage anyone to jump in on these. Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-2 A description (P2) Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.
Projects
None yet
Development

No branches or pull requests

4 participants