-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
Text Doesn't Reflow Properly on Window Resize after Vim Opened and Closed #7466
Comments
Is this vim.exe, or a vim from a wsl distro? |
Sorry, vim.exe. |
I have similar and I think "same" problem. When I open an Ubuntu tab in Windows Terminal, unless the terminal is exactly 50 lines and 140 columns, vim draws screen incorrectly (it's seemingly clear that vim thinks the dimensions are as above, 50x140). I can provide some debugging information that can help re-create. If you use the "tput lines" and "tput cols" command, the window should print correspondingly the number of lines and columns:
After resizing with mouse, the window correctly reports the new sizes:
Now, if you execute "vim", the screen looks something like: and after exiting (since you can't really effectively edit :-(... lines and cols are back to the default, and no longer represent the actual lines and cols of the window.
However, what's odd, is in some cases I have been able to initiate an Ubuntu tab and after using "tput lines" and "tput cols", the screen behavior is fine and remains consistent even with window resizing. It seems once a tab is working, it continues to work fine. This so far is random to me. I've not been able to predict, nor coax a tab into good behavior, nor stop one that is working from going back to the incorrect behavior. |
@elhannah Is it possible you've got something like |
I wondered that too, but there are no references in .vimrc.
What's odd is that in one tab I *did* get size working, and it behaved
perfectly as I resized. But it was not reliably reproducible.
A couple of other interesting additions to the conversation:
1. I found that if I modified the json config file and instead of
"source" for wsl, I changed the invoke to "commandline", much like the
powershell configuration, and the commandline is simply the linux
distribution of your choice. I have Ubuntu, openSUSE-42, and kali-linux,
and they all work fine with vi when defined that way.
2. *However*, :-), regardless of whether I have vi window dimensions
correctly matching the windows terminal, I find that when I start vi, about
10 to 25% of the time it starts in "REPLACE" mode, meaning that any
characters I enter are going into vi as input, but vi is supposed to start
in "normal" mode. This is easily overcome by hitting ESCAPE and continuing
but it is confusing, and also leads me to wonder if in fact it's more than
just a "first startup" idiosyncrasy, or if something else might be going on
and that odd behaviors continue within the vi session.
I was happy that my configuration mod worked generally for window
dimensions and dynamic re-sizing, but I'm concerned enough about the other
issue and what is going on to continue to rely on the WSL command
window/terminal in the meantime.
Thanks for response, I will read #5094, and provide any additional feedback
if necessary.
Have a great day!
|
This comment has been minimized.
This comment has been minimized.
The REPLACE mode problem is probably issue #1637. One theory is that it's got something to do with vim sending a cursor position requestion, for which the response is an escape sequence ending with |
@elhannah I think that might be a different problem -- I'm not seeing any problem with vim opening in replace mode, and resizing while Vim's open works fine. Maybe because I'm launching vim.exe from powershell rather than vim in an ubuntu terminal? |
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").)
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Hey sorry for letting this go untriaged for so long - @Jacob-Bishop could you share your powershell profile? Have you done anything to your |
I know you're asking Jacob, but I had the same issue, and no reference in
.vimrc to setting lines and columns.
But! The good news is I have the latest version of Terminal, and the issue
has been resolved. It seems to be working perfectly now.
Thanks.
|
@zadjii-msft, thanks for looking into this:
Current Windows Terminal version is 1.3.2651.0, the latest version on the Microsoft Store. Let me know if there is other information that would be useful. One additional note that I don't think I mentioned originally, which may be helpful in your attempts to reproduce- lines created after exiting Vim are correctly anchored to the left side of the terminal, but lines created before opening vim are not. |
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! |
Environment
Steps to reproduce
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

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.
The text was updated successfully, but these errors were encountered: