-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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
Line wrapping problem in bash on ubuntu on windows #17609
Comments
The problem is not occur every time, try killing the terminal and reopen might occur. |
It appears to me that this only happens when maximizing the window. The point where it Incorrectly wraps is the previous width of the terminal while the window was not maximized. |
Much work has happened in the next build, could you try this out again on the Insiders build? |
@Tyriar I'm on 1.9.0-insider and I can confirm that it still happens there. |
Not sure if this is directly related to VSCode, I found this Issue while trying to figure out why the Bash on Ubuntu on Windows was failing to properly wrap lines. Don't believe I had this issue three weeks ago, cropped up for me in a recent Windows update. I'm on Version 1607, OS Build 15017.1000, and am running into this bug. |
I am still experiencing this issue, and it is very annoying. I'm running VSCode 1.9.1 on Build 14986.rs_prerelease.161202-1928. Bash on Windows does not have the line wrapping issue. Please consider prioritizing this, as it reduces the terminal's usefulness significantly. |
I'm now on 1.12.0-insider and Windows build 15063.13 and the issue is still there and still very annoying. This issue is labeled as "needs more info" - what info is needed? How can I provide it to help resolving the problem? |
@Tyriar I'm not so sure, because actually #19665 sounds like the same as #25133 and #25126 (causing text to shift to the left and the cursor to stay), and this problem instead causes lines to wrap before they reached the end and then overwrite the text on the same line from the left (not shifting anything and not separating the text from the cursor). Also it would appear that #19665/#25133/#25126 are triggered by specific characters or other similar things which happen inside the console, while this issue is triggered by maximizing VSCode (regardless of what happens in the console). Apart from that, I have this issue for months now, while the other issue (with shifted text) started only a few days ago for me. |
@CherryDT ah ok, I was wondering if this one was still happening. I assumed you were seeing the other one due to the flood of reports I was going through after Creator Update started going out. |
@Tyriar OK so the question remains what "more info" is needed for you to get to the bottom of this? I will be glad to help where I can... |
@Tyriar A little update, I investigated a bit more. It is not only limited to maximizing. The issue happens as soon as the window width is increased rapidly. When I use the window border to resize it, it gets a WM_SIZE on every few pixels and this appears to work fine. However when I maximize the window or when I use the MoveWindow API to increase the window size by 50 pixels at once or so, it doesn't work and this problem starts appearing. It will then start incorrectly wrapping and overwriting itself at that specific position where the wrapping point was before the sudden width change. |
@CherryDT so it looks like there's 2 issues here:
|
@Tyriar Hm, in fact it behaves very strangely because things like Also I noticed that after the maximizing, it can be possible to add more characters at first but then it starts wrapping and "looping" to a smaller width. All kinda hard to explain. Here you have an illustration of what is happening: http://recordit.co/npWkMirE0r |
@Tyriar Sorry forgot the devtools before - here is a screenshot: https://i.imgur.com/LeazsIQ.png |
@CherryDT thanks for the follow up 😃 @rprichard any idea what's going on in the screencast/screenshot above? It looks like the terminal width is correctly bring set but there's some really weird wrapping behavior happening in WSL. AFAIK there has always been weird prompt wrapping behavior like this. |
@CherryDT by always I mean since the integrated terminal was introduced, I noticed oddities like this when I was playing with WSL many months ago. |
I'm able to reproduce this issue. I see problems both with wrapping the bash command-line and with vim. I also notice that the Aside: winpty's window-resize code is sadly complicated because Windows doesn't provide an API that Just Works. It provides one API that changes the window size (subject to various constraints), another API to change the buffer size (subject to other constraints), and a final API that (supposedly?) changes both, as well as a bunch of other things that applications want to change (e.g. the current text color), so winpty can't use it. I'll dig into this more. The fix is probably, "do something that triggers another resize notification". ... There isn't a console input event for a changed window size, but there is one for a changed buffer size. If nothing else, I bet winpty could synthesize |
I created a winpty issue, rprichard/winpty#110. |
Cool, thanks for looking into it! I just wonder why it will then wrap without going to the next line... |
My guess: The line-editing system (e.g. readline) thinks the terminal has advanced to a new line when it really hasn't, and maybe when readline alters a line, it redraws a whole line. To do that, it first returns to the start of the line with CR. |
Is there any ETA when this fix (which is already closed in winpty) will make it into VSCode? |
I could release the next winpty version if that helps.
|
Cool, I hope it will aid in getting this released in VSCode soon. |
If a winpty release goes out, provided there are no regressions this should make it into the May release. |
I published winpty 0.4.3, which contains the fix for this issue. If anyone wants to test it before VSCode updates its winpty, it should be possible by replacing the FWIW: this winpty release has fixes for three other issues that affected VSCode (arrow keys in the Ruby REPL, AltGR keys, and the 5px console font height). |
Anyone experiencing the issue could you test in tomorrow's Insiders build? It seemed to work fine on my machine with the update. |
Seeing this on Linux and Mac (haven't tried Windows) with the first terminal in a new window. |
@chrmarti there's another issue tracking that, this one is strictly about Windows. |
Looks solved to me :) |
@Tyriar I see this in Windows in the first terminal of a new window, the width is not measured correctly but wrapping is ok. If I resize anything, it lays itself out correctly. Expected or new issue? |
@roblourens I'm aware of it, and it's related to #20505. I don't think there's an issue yet so created #28138 |
Hello, I am running VSC Version 1.18.0 on OSX High Sierra. I am experiencing this same behavior - text overwrites the bash shell command prompt - upon having added an emoji to my command prompt. This happens no matter the window size and also on multiple terminal tabs. |
When the line is full, terminal doesn't start a new line, instead of starting at the same line and eating the chars.
Steps to Reproduce:
"terminal.integrated.shell.windows": "C:\\Windows\\sysnative\\bash.exe"
The text was updated successfully, but these errors were encountered: