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

Windows Terminal text glitches when using vim ! #6865

Closed
KadaGuetouache opened this issue Jul 10, 2020 · 42 comments
Closed

Windows Terminal text glitches when using vim ! #6865

KadaGuetouache opened this issue Jul 10, 2020 · 42 comments
Labels
Area-Output Related to output processing (inserting text into buffer, retrieving buffer text, etc.) Help Wanted We encourage anyone to jump in on these. Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Tag-Fix Doesn't match tag requirements Priority-2 A description (P2) Product-Conpty For console issues specifically related to conpty Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.
Milestone

Comments

@KadaGuetouache
Copy link

KadaGuetouache commented Jul 10, 2020

Environment

Windows build number: [run `[Environment]::OSVersion` for powershell, or `ver` for cmd]
Windows Terminal version (if applicable):
Microsoft Windows [Version 10.0.19041.329]

Windows Terminal
Version: 1.0.1811.0
Any other software?

Using WSL2

Vim VIM - Vi IMproved 8.1 (2018 May 18, compiled Apr 15 2020 06:40:31)                         

# Steps to reproduce
Inside vim open curly brackets and hit tab.
<!-- A description of how to trigger this bug. -->

# Expected behavior
should work just fine.
<!-- A description of what you're expecting, possibly containing screenshots or reference material. -->

# Actual behavior
After some typing the text will be all around and becomes messing and hard to read.
opening window splits in vim and start jumping between then we clear the glitch just to start type again and mess start again.
<!-- What's actually happening? -->
@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 10, 2020
@DHowett
Copy link
Member

DHowett commented Jul 10, 2020

Any other software?

You didn't list any other software.

  • What version of vim?
  • Are you using WSL?
  • Are you using vim inside WSL?
  • Are you using vim over SSH?
  • If you are using ssh, what version of ssh?

@DHowett DHowett added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Jul 10, 2020
@ghost ghost added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Jul 10, 2020
@KadaGuetouache
Copy link
Author

Here is a sample of the text glitch on WT
Capture

@KadaGuetouache
Copy link
Author

KadaGuetouache commented Jul 11, 2020

@DHowett

Any other software?

You didn't list any other software.

  • What version of vim?
  • Are you using WSL?
  • Are you using vim inside WSL?
  • Are you using vim over SSH?
  • If you are using ssh, what version of ssh?

yes i'm using Vim version 8.1 that runs inside WSL 2 (Ubuntu 20.04 ) and i'm not using SSH.

@KadaGuetouache
Copy link
Author

After some windows updates it seems like the issue has gone so i will close this Issue.

@KadaGuetouache
Copy link
Author

Problem still exits It's been months now and I haven't found a solution for this problem. The only think that I can do is close and open windows terminal app.

@zadjii-msft
Copy link
Member

Are you using any sort of vim plugins?

The only think that I can do is close and open windows terminal app.

That seems like a bit of an aggressive solution - does just closing an re-opening vim reset the buffer to something reasonable?

@zadjii-msft zadjii-msft added Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something and removed Needs-Attention The core contributors need to come back around and look at this ASAP. labels Mar 23, 2021
@ghost ghost added the No-Recent-Activity This issue/PR is going stale and may be auto-closed without further activity. label Mar 27, 2021
@ghost
Copy link

ghost commented Mar 27, 2021

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@ghost ghost closed this as completed Mar 30, 2021
@bluddy
Copy link

bluddy commented Nov 9, 2021

I'm experiencing the same issues with both vim and neovim. Opening a split and scrolling up/down causes serious visual issues.

@ghost ghost removed the No-Recent-Activity This issue/PR is going stale and may be auto-closed without further activity. label Nov 9, 2021
@kvnmlm
Copy link

kvnmlm commented Jan 6, 2022

Scrolling up and down is a killer. Have to figure this out cause this kills using WSL completely.

@bluddy

This comment has been minimized.

@zadjii-msft
Copy link
Member

@kvnmlm we closed this since we couldn't get more feedback from OP, but if you like to help debug:

  • What version of vim?
  • Are you using vim over SSH?
  • If you are using ssh, what version of ssh?

Also:

  • Does this repro without your vim profile? If it doesn't, could you share your .vimrc?

@bluddy
Copy link

bluddy commented Jan 6, 2022

Stepping in to answer: this happens both in vim and neovim, and doesn't require plugins, though it's more apparent with various plugins. The contents of the buffer all glitch out to various degrees. This is a showstopper from the perspective of my workflow, which is why I didn't bother sticking with Windows Terminal once I realized it was a terminal-specific issue and not a WSL2 one.

@zadjii-msft
Copy link
Member

Well, we'd love to help figure that out! Curious that we haven't heard more reports of this - you'd think that a pretty major bug like that would have more reports if it was more widespread.

Is there anything else interesting about your setup? What shell are you using? Maybe you're running vim in tmux or screen? Maybe you've got TERM set to something weird?

Is there a specific set of steps that repros this consistently (ideally from an initially empty vim buffer)?

@zadjii-msft zadjii-msft reopened this Jan 6, 2022
@bluddy
Copy link

bluddy commented Jan 6, 2022

Hmm. Trying to make the bugs appear again, I'm not having success. I do use vim in zsh and tmux, but I switched away from Windows Terminal several Windows Update cycles ago, as well as updating my laptop video drivers to the latest from Intel. I'll switch back to Windows Terminal and see if it comes back and report here if it does.

@kvnmlm
Copy link

kvnmlm commented Jan 7, 2022

  • What version of vim?
    :version
    VIM - Vi IMproved 8.1 (2018 May 18, compiled Nov 08 2021 14:21:34)
  • Are you using vim over SSH?

No, WSL on my machine. New to using WSL, cygwin user for years.

At first windows terminal looked nice but it tailed off pretty quickly.

I live in putty sshed into linux boxes daily using tmux most of the time. Love putty, tolerate tmux.

  • If you are using ssh, what version of ssh?
    n/a
    Does this repro without your vim profile? If it doesn't, could you share your .vimrc?

Trying at the moment and it is working normally. Very strange cause last night everything I touched was hosed.

Will use it throughout the evening and report back when I break it. I'll ditch my very simple .vimrc after it breaks again.

EDIT, ADDING:

Is there anything else interesting about your setup?

Don't believe so. New machine, building up dev environment though most work in sshed to linux boxes.

What shell are you using?
$ echo $SHELL
/bin/bash

Maybe you're running vim in tmux or screen?
Nope.

Maybe you've got TERM set to something weird?
$ echo $TERM
xterm-256color

@kvnmlm
Copy link

kvnmlm commented Jan 7, 2022

It's happening again. I scroll down to bottom then as I scroll up it starts creating these lines which look like the vim cursor line. I'll add bottom of file in the term window a lot of weird tildes like a term problem of some sort.
image

EDIT: Here are the tildes below the editor window and acroos the full terminal window far beyond any text width in vim.
image

@kvnmlm
Copy link

kvnmlm commented Jan 7, 2022

Further debug dropping .vimrc and then going after the cursor line. This is the .vimrc line which kills it:

 set cursorline

Removing it seems to fix things. Time will tell if that is the root but looks that way to me at moment.

So, to test, I deleted .vimrc again so the cursorline and whole vimrc. Was going to set cursorline and see if it comes back. When I open a non-existent ~/.vimrc I get the strange tildes all over the place.

When I edit any file which doesn't exist, I get the tilde thing.

Tried on a linux box, centos at my fingertips, editing vim a non-existent file very nicely opens and then lets you create a file.

Tried ubuntu on linux box, works great.

@zadjii-msft zadjii-msft modified the milestones: 22H1, Terminal v1.14 Feb 2, 2022
@DHowett DHowett removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Feb 14, 2022
@Aadv1k
Copy link

Aadv1k commented Feb 16, 2022

Sad that this occurs so often, it is a pain to work with vim/NeoVim with windows terminal, here is my vimrc and I keep facing the same glitched text issue, where the text sometimes appears on the signcolumn, or sometimes gets misplaces when using splits.

@zadjii-msft zadjii-msft modified the milestones: Terminal v1.14, 22H2 Mar 10, 2022
@mhchen
Copy link

mhchen commented Mar 12, 2022

I'm glad I'm not the only one after seeing so many people praise Window Terminal.

image

This is my terminal with tmux open after having closed neovim. I ran a bunch of git commands but there were a bunch of artifacts that remained from vim. When my terminal is in this state, even clear doesn't work (it jumps my prompt to the top of the terminal but doesn't clear any of the text or artifacts). When I connect to the same tmux session in other terminals like Hyper, the artifacts are gone.

Windows Terminal is my favorite balance of speed and aesthetics, but this issue makes it entirely unusuable for me for my vim/tmux workflow.

@mhchen
Copy link

mhchen commented Mar 12, 2022

image

Here's another example of me opening up a popup/float window using COC in Neovim while using tmux. It renders totally incorrectly, appearing to wrap around to the other tmux pane. Again, no problems with this using other terminals, even when connected to the same tmux session. Here's a screenshot of the same section in Hyper:

image

Note that after this happens, my Windows Terminal will gradually leave more artifacts like the one pictured in my comment above until I kill tmux.

@Aadv1k
Copy link

Aadv1k commented Mar 13, 2022

wt-glitch-2
wt-glitch-1

The problem with these glitches is that they persist until I quit my entire vim session

@zadjii-msft
Copy link
Member

@Aadv1k & @mhchen you're likely running into #6987, or at least the artifact you're reporting looks more like that issue.

...

Maybe, maybe not though. Let's be sure about that.

@Aadv1k thanks for sharing your vimrc - could I get a couple other pieces of info, just to narrow things down?

  • Are you using vim in WSL? In mingw/git bash / cygwin? (if so which version?) oh okay from the screenshot you're using WSL, that keeps that easy.
  • Are you sing any sort of ssh?
  • Does this need tmux to repro? Are you using any sort of tmux config?
  • which vim version specifically are you using?
  • Is there an exact set of steps to repro the issue? Like, "open {this file}, then make a vertical split, then start scrolling"? The actual file contents may be relevant here...

Cause like, look at this snippet:
image

What's that red box char there? Maybe that's something that's ambiguous width, and what's confusing conpty here. The following line has the artifact on it, so maybe that triggered it.


I'm tempted to close this thread and punt back to #6987. OP is MIA so I can't really get any more info to debug from them. The second artifact in this issue looks like #9359, but that poster has stopped using the Terminal so it's gonna be hard to get more info from them

@Aadv1k
Copy link

Aadv1k commented Mar 15, 2022

To answer your questions line by line;

Are you sing any sort of ssh?

Nope, this is Ubuntu 20.04 running on wsl2

Does this need tmux to repro? Are you using any sort of tmux config?

No, it even happens without tmux, the main culprit seems to be vim's navigations and splits here which cause the tearing

which vim version specifically are you using?

Sorry for not specifying but I am not using vim at all I am using NVIM v0.6.1

Is there an exact set of steps to repro the issue? Like, "open {this file}, then make a vertical split, then start scrolling"? The actual file contents may be relevant here...

Open any file, and then just start navigating around, open vertical splits, horizontal splits, navigate across the file, that's pretty much it, there aren't any "steps" this just happens while navigating, even worse when using set cursorline

What's that red box char there? Maybe that's something that's ambiguous width, and what's confusing conpty here. The following line has the artifact on it, so maybe that triggered it.

That is actually my lsp, I use nvim-lspconfig tearing never usually happens around my lsp, such issues happen around the signcolumn and/or the number column.

I really hope this is resolved as it is really a pain to not be able to use such a great terminal like windows terminal.

@zadjii-msft
Copy link
Member

Is there an exact set of steps to repro the issue? Like, "open {this file}, then make a vertical split, then start scrolling"? The actual file contents may be relevant here...

Open any file, and then just start navigating around, open vertical splits, horizontal splits, navigate across the file, that's pretty much it, there aren't any "steps" this just happens while navigating, even worse when using set cursorline

I'm aware that this is gonna sound super annoying, but do you have a specific set of steps that repros this 100%? I mean an exact "open this .scss file, scroll to line 80, open a new vertical split, then open nerdtree with :NERDTree, Press I, {do whatever}"? I played with your vimrc for like half an hour this morning and couldn't get it to repro. Same with the folks in #6987 - while it does seem consistently to affect the people it affects, finding an exact repro has been really tricky. I really just want to get these two knocked out, since they're super breaking for the people they affect.

@Aadv1k
Copy link

Aadv1k commented Mar 15, 2022

Is there an exact set of steps to repro the issue? Like, "open {this file}, then make a vertical split, then start scrolling"? The actual file contents may be relevant here...

Open any file, and then just start navigating around, open vertical splits, horizontal splits, navigate across the file, that's pretty much it, there aren't any "steps" this just happens while navigating, even worse when using set cursorline

I'm aware that this is gonna sound super annoying, but do you have a specific set of steps that repros this 100%? I mean an exact "open this .scss file, scroll to line 80, open a new vertical split, then open nerdtree with :NERDTree, Press I, {do whatever}"? I played with your vimrc for like half an hour this morning and couldn't get it to repro. Same with the folks in #6987 - while it does seem consistently to affect the people it affects, finding an exact repro has been really tricky. I really just want to get these two knocked out, since they're super breaking for the people they affect.

This is the strangest part about this, there really aren't any steps that can reproduce this exactly, it just randomly occurs, I try to document whenever it does happen, so I will update.

For the most part, having set cursorline and extensively using the visual mode in splits seem to be the biggest culprits in this case.

@Aadv1k
Copy link

Aadv1k commented Mar 16, 2022

Is there an exact set of steps to repro the issue? Like, "open {this file}, then make a vertical split, then start scrolling"? The actual file contents may be relevant here...

Open any file, and then just start navigating around, open vertical splits, horizontal splits, navigate across the file, that's pretty much it, there aren't any "steps" this just happens while navigating, even worse when using set cursorline

I'm aware that this is gonna sound super annoying, but do you have a specific set of steps that repros this 100%? I mean an exact "open this .scss file, scroll to line 80, open a new vertical split, then open nerdtree with :NERDTree, Press I, {do whatever}"? I played with your vimrc for like half an hour this morning and couldn't get it to repro. Same with the folks in #6987 - while it does seem consistently to affect the people it affects, finding an exact repro has been really tricky. I really just want to get these two knocked out, since they're super breaking for the people they affect.

I won't be writing any further comments here as the issue might not be windows terminal at all, I have been using it extensively and no issues, at least for now.

@zadjii-msft
Copy link
Member

there really aren't any steps that can reproduce this exactly, it just randomly occurs

Yep, that sounds like #6987 alright. As mentioned, I'm gonna close this second half of the discussion as a /dupe of #6987. If folks find this thread and DO have a consistent way to repro, then I'm all ears over in that thread. If you see some other rendering glitch in vim that looks different, then let's start a new thread.

@ghost
Copy link

ghost commented Mar 16, 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 added Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing. Needs-Tag-Fix Doesn't match tag requirements labels Mar 16, 2022
@EnGamma
Copy link

EnGamma commented Jul 6, 2022

I propose reopening this issue. I don't think this is a duplicate of #6987.

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.

I've found 2 cumbersome workarounds for now:

  1. Resize the terminal widow or
  2. Toggle full screen [F11] [F11] or [ALT]-{ENTER] [ALT]-[ENTER]

Performance is normal after that.

@Aadv1k
Copy link

Aadv1k commented Jul 6, 2022

I propose reopening this issue. I don't think this is a duplicate of #6987.

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.

I've found 2 cumbersome workarounds for now:

  1. Resize the terminal widow or
  2. Toggle full screen [F11] [F11] or [ALT]-{ENTER] [ALT]-[ENTER]

Performance is normal after that.

Adding to this, for some reason even after setting padding to be 0, there is still a thin border at bottom and left of the windows terminal screen, doesn't go in full screen

image

@zadjii-msft
Copy link
Member

@EnGamma That sounds like a different bug than this one - mind filing a new issue?


@Aadv1k That too is a different issue - in your case, the space that's there on the bottom of the window isn't big enough for an entire row of text, so we just fill it with blank space. That's generally preferable to a row of characters that's only partially visible. Otherwise, the only solution would be to prevent the window from filling the entire screen while maximized, which I'm sure that no one really wants. See also #6021

@EnGamma
Copy link

EnGamma commented Jul 6, 2022

@EnGamma That sounds like a different bug than this one - mind filing a new issue?

I filed a new report #13441, but I do think there are commonalities with some of the reports above.

@mj-hd
Copy link

mj-hd commented Aug 6, 2022

I'm facing the text glitches without tmux. (with neovim v0.7.2)

left: Windows Terminal 1.14.1963.0
right: WSL Terminal

Video.mp4

When I move the cursor around the virtual texts, the texts below shift by one line.
This issue prevents me to use Windows Terminal for daily development...

Should I open another issue for this, or this issue should be reopened?

@EnGamma
Copy link

EnGamma commented Aug 7, 2022 via email

@Aadv1k
Copy link

Aadv1k commented Aug 8, 2022

This issue seems to be on and off pretty regularly. From this thread and expereinces - this specific issue is caused in neovim configured with LSP or similar derivates that make use of signcolumns. The issue is ususally find alongside

  • init.vim with set cursorline opt
  • Nerd fonts or other fonts that cause such artifacts (In my case, code new roman was causing issues)
  • Extensive navigation around splits and usage of visual mode
  • Other funky settings that mess with the rendering of the screen (colorschemes, LSP messages, statuslines)

NOTE: This is merely an observation from the long threads above, and includes some of my own experiences as well.

@zadjii-msft
Copy link
Member

@mj-hd That looks like a different issue than the one tracked at the start of this thread. I'd file a new issue, and make sure to include your vimrc / any other relevant config.

@mj-hd
Copy link

mj-hd commented Aug 9, 2022

Ok, thank you. I will check my vimrc and fonts to avoid these glitches, then open a new issue if the glitches still exist.

@bluebrown
Copy link

I also have glitches in neovim and helix editor. I am sure it's not a misconfiguration, but a Windows terminal issue.

@jradam
Copy link

jradam commented Feb 6, 2023

Not sure if this is the same issue, but glitches start occurring for me only after running a terminal process within Vim.

Once a process is running, the glitches slowly start occurring everywhere - and keep occurring even after quitting the process.

The glitches take a while to creep in, but can be triggered instantly by opening a floating window:

glitches.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Output Related to output processing (inserting text into buffer, retrieving buffer text, etc.) Help Wanted We encourage anyone to jump in on these. Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Tag-Fix Doesn't match tag requirements Priority-2 A description (P2) Product-Conpty For console issues specifically related to conpty 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