-
Notifications
You must be signed in to change notification settings - Fork 8.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
Make sure WT can copy wrapped lines as a single line #3367
Comments
This is due to a lack of wrapping copy, not paste. |
Does this happen in latest cygwin also? |
@Biswa96, I do not use cygwin since 2014. The basic DLL in MSYS2 is the same version:
BTW, in MinTTY-MSYS2 it works as expected, without problems (the same as in Ubuntu-WT or CMD-WT profiles). See the MSYS2 profile I posted above, may be it need some adjustment? Some other environment variable or what else? |
Try this |
No, it has the same issue. Beside this, I need to set those environment variables.. How with the command line you suggest? |
This problem also exists for me. For me, the scenario that caused the issue was that I tried to copy the Dockerfile cross-line command to the Windows Terminal (WSL2), there would be extra blank lines, and bash would be recognized as a one-line command. |
Same issues with WT 0.7... |
|
The issue seems related to When one starts MSYS2 with the launcher Now if I use in the WT profile
the issue seems fixed and the line is 130 craracters long but Emacs in terminal ( |
How about |
No, it is worse. For completeness, I have attached the result with MinTTY-TERM=xterm, WT-TERM=xterm, WT-TERM=xterm-256color. emacs-WT.tar.gz |
For the sake of completeness, the issue is still active in the last |
@angelog0 thank you. Since this isn’t a bug and requires actual investment to make the line wrapping feature work, we aren’t likely to fix it accidentally. We will definitely close this workitem when we know it to be complete. |
## Summary of the Pull Request Changes how conpty emits text to preserve line-wrap state, and additionally adds rudimentary support to the Windows Terminal for wrapped lines. ## References * Does _not_ fix (!) #3088, but that might be lower down in conhost. This makes wt behave like conhost, so at least there's that * Still needs a proper deferred EOL wrap implementation in #780, which is left as a todo * #4200 is the mega bucket with all this work * MSFT:16485846 was the first attempt at this task, which caused the regression MSFT:18123777 so we backed it out. * #4403 - I made sure this worked with that PR before I even sent #4403 ## PR Checklist * [x] Closes #405 * [x] Closes #3367 * [x] I work here * [x] Tests added/passed * [n/a] Requires documentation to be updated ## Detailed Description of the Pull Request / Additional comments I started with the following implementation: When conpty is about to write the last column, note that we wrapped this line here. If the next character the vt renderer is told to paint get is supposed to be at the start of the following line, then we know that the previous line had wrapped, so we _won't_ emit the usual `\r\n` here, and we'll just continue emitting text. However, this isn't _exactly_ right - if someone fills the row _exactly_ with text, the information that's available to the vt renderer isn't enough to know for sure if this line broke or not. It is possible for the client to write a full line of text, with a `\n` at the end, to manually break the line. So, I had to also add the `lineWrapped` param to the `IRenderEngine` interface, which is about half the files in this changelist. ## Validation Steps Performed * Ran tests * Checked how the Windows Terminal behaves with these changes * Made sure that conhost/inception and gnome-terminal both act as you'd expect with wrapped lines from conpty
Okay: as far as I can tell, your shell is inserting a manual line break one character before the console would word-wrap. It's inserting a literal manual line break, so there's no hope that WT can recover from that. If I emit the contents of a long text file to the screen, it writes all the way up to the right edge and copies out of WT as a single line. If the application emits its own newline because it misunderstood the size of the screen, it writes all the way up to the newline and copies out of WT as two lines. As long as they're doing that, by literally telling us to break the line, there isn't anything we can do to repair it. We've fixed all other known cases of broken line wrap on copy/paste. |
@DHowett-MSFT you are missing that only in WT that occurs. In MinTTY and other terminals copy/past of long lines works as expected. Admitting your conclusions would admit that WT is not usable as terminal with MSYS2 and friends. Maybe I will switch back to MinTTY because this is an issue tha causes many trouble to me. |
I can't help that msys has a special contract with MinTTY. If you do this in the traditional windows console, it has the same behavior. This is 100% an application bug. Conhost has supported line wrapping for five years -- it also works for every other application that correctly prints to the edge of the screen. It might be time for MSYS to reconsider how it interacts with the console. |
I created this profile (since WT 0.5),
and noticed that when I paste a long line as in
it works wrong
This does not occur in Ubuntu or DOS or PoweShell profiles.
In short, it does not like the end of line when using MSYS2 profile. Maybe you have some suggestions...
(BTW, I copied that line dragging the mouse and pasting with right click, as usually one have to do in WT)
The system is W10 Pro 64 10.0.18362.449.
The text was updated successfully, but these errors were encountered: