terminal: Text Doesn't Reflow Properly on Window Resize after Vim Opened and Closed

Environment

Windows build number: 10.0.18362.0
Windows Terminal version: 1.2.2381.0
Vim: 8.1

Steps to reproduce

  1. Open Powershell in a Windows Terminal tab.
  2. Launch Vim.
  3. Close Vim.
  4. Expand the terminal window on the right side (i.e., use the mouse to resize the window).

Expected behavior

The beginning of each “PS” prompt should be anchored to the left-hand side of the window.

Actual behavior

The second “PS” prompt wraps backward onto the first line image

Notes

This might be a duplicate with @waf’s report in #7232, although this is about resizing the terminal after vim has exited and his report was about resizing the terminal while vim was open.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 4
  • Comments: 16 (4 by maintainers)

Most upvoted comments

@elhannah Is it possible you’ve got something like set lines=50 columns=140 in your .vimrc file? Those are options that vim uses to set the default window size, but that resizing functionality is not yet supported by Windows Terminal (see issue #5094). The problem is that conhost does actually support resizing, so the conhost backend and the Terminal frontend get out of sync, and that results in everything rendering in the wrong place.

So, I think that this is another instance of #3088. It’s not titled correctly, but there’s something that vim does when launches/exits that causes it to print out every character that was on the screen. After that happens, lines in the buffer are incorrectly marked as wrappable.

/dup #3088

right, this happens from a tab running ubuntu in windows terminal.

from a powershell tab I’ve not been able to recreate the REPLACE mode bug. I am invoking explicitly the vim.exe (I’m running vim 8.2).

You can see how many times I’ve invoked in this screen shot:

[image: image.png]

However, there is something odd with vim’s behavior in the powershell window. as I type in input mode, random placement of characters appear, it looks like it’s mostly on the same line that I’m typing. I’ll do more with this to see if I can get more specific descriptions.

(As a side note, some of this is interesting and important to me as I’m in the middle of writing the 8th Ed of the O’Reilly “Learning the vi and Vim Editors https://www.amazon.com/Learning-Vim-Editors-Processing-Maximum/dp/059652983X/ref=cm_cr_arp_d_product_top?ie=UTF8” book. I’m trying to describe and include as much landscape as possible where vim runs (under the heading of “vim is everywhere”).)