Option to disable ConPty wrapping/reflow functionality #7231

Closed
opened 2026-01-31 00:58:28 +00:00 by claunia · 11 comments
Owner

Originally created by @kchibisov on GitHub (Mar 31, 2020).

From what I've seen in some alacritty bug reports e.g, it seems like ConPty is doing wrapping/reflow by itself, which is pretty annoying if your terminal can handle all of that. So it also interferes with our logic from time to time and breaks some of our features. Ideally it'll be nice to have an option to prevent ConPty of doing so(ideally I want ConPty to be 'just a pipe', which forwards things to us directly without any black magic under the hood, but meh).

The main problem that this feature would solve is that it'll help other terminals out there who is capable of handling content reflow by themselves have their reflow/wrap related features working, since ConPty can't handle use cases like: split across line selection with double clicks aka select a word, triple click on a line, which should select the entire wrapped line, URL clicking and launching, reflow of multiple cursors(alacritty has a keyboard driven mode to select text and a special cursor for it), selections, etc, etc.

Originally created by @kchibisov on GitHub (Mar 31, 2020). From what I've seen in some alacritty bug reports [e.g](https://github.com/alacritty/alacritty/issues/3361#issuecomment-606531771), it seems like ConPty is doing wrapping/reflow by itself, which is pretty annoying if your terminal can handle all of that. So it also interferes with our logic from time to time and breaks some of our features. Ideally it'll be nice to have an option to prevent ConPty of doing so(ideally I want ConPty to be 'just a pipe', which forwards things to us directly without any black magic under the hood, but meh). The main problem that this feature would solve is that it'll help other terminals out there who is capable of handling content reflow by themselves have their reflow/wrap related features working, since ConPty can't handle use cases like: split across line selection with double clicks aka select a word, triple click on a line, which should select the entire wrapped line, URL clicking and launching, reflow of multiple cursors(alacritty has a keyboard driven mode to select text and a special cursor for it), selections, etc, etc.
claunia added the Issue-FeatureNeeds-TriageNeeds-Tag-Fix labels 2026-01-31 00:58:28 +00:00
Author
Owner

@j4james commented on GitHub (Mar 31, 2020):

I think what you probably want is the passthough mode discussed in #1173. I don't see how wrapping could be disabled without that, unless I've misunderstood your request.

@j4james commented on GitHub (Mar 31, 2020): I think what you probably want is the passthough mode discussed in #1173. I don't see how wrapping could be disabled without that, unless I've misunderstood your request.
Author
Owner

@j4james commented on GitHub (Mar 31, 2020):

That said, it looks like PR #4415 might help with this issue. I'm not sure if that's been released in a version that you can test yet, but you could always build it yourself to check if it makes any difference.

@j4james commented on GitHub (Mar 31, 2020): That said, it looks like PR #4415 might help with this issue. I'm not sure if that's been released in a version that you can test yet, but you could always build it yourself to check if it makes any difference.
Author
Owner

@kchibisov commented on GitHub (Mar 31, 2020):

That said, it looks like PR #4415 might help with this issue. I'm not sure if that's been released in a version that you can test yet, but you could always build it yourself to check if it makes any difference

It really seems like the thing we want tbh, thank you for linking this, I don't have any windows machine to test this myself, however I'll link it on our tracker, so folks, who are running windows can test it, and check if it works for them.

I'll close this issue for now.

@kchibisov commented on GitHub (Mar 31, 2020): >That said, it looks like PR #4415 might help with this issue. I'm not sure if that's been released in a version that you can test yet, but you could always build it yourself to check if it makes any difference It really seems like the thing we want tbh, thank you for linking this, I don't have any windows machine to test this myself, however I'll link it on our tracker, so folks, who are running windows can test it, and check if it works for them. I'll close this issue for now.
Author
Owner

@mintty commented on GitHub (Oct 7, 2024):

This issue should be reopened, still unhandled after 4 years. See my renewed attempt to raise awareness of the problem in microsoft/WSL#12143.

@mintty commented on GitHub (Oct 7, 2024): This issue should be reopened, still unhandled after 4 years. See my renewed attempt to raise awareness of the problem in microsoft/WSL#12143.
Author
Owner

@DHowett commented on GitHub (Oct 7, 2024):

Preview 1.22 doesn't reflow via ConPTY any longer. There would be no value in reopening this issue.

@DHowett commented on GitHub (Oct 7, 2024): Preview 1.22 doesn't reflow via ConPTY any longer. There would be no value in reopening this issue.
Author
Owner

@mintty commented on GitHub (Oct 8, 2024):

Preview 1.22

Please give some details: Preview of what? (Windows 11/Windows Terminal/...)
Does it also pass input/output sequences unfiltered?
Are sources of wsl.exe available?

@mintty commented on GitHub (Oct 8, 2024): > Preview 1.22 Please give some details: Preview of what? (Windows 11/Windows Terminal/...) Does it also pass input/output sequences unfiltered? Are sources of wsl.exe available?
Author
Owner

@DHowett commented on GitHub (Oct 8, 2024):

Windows Terminal

Yes

No

@DHowett commented on GitHub (Oct 8, 2024): Windows Terminal Yes No
Author
Owner

@mintty commented on GitHub (Oct 8, 2024):

You seem to mean that replaceming conhost with OpenConsole changes wsl.exe behaviour.
Unfortunately, unlike previous versions, that does not work in Windows 10.

@mintty commented on GitHub (Oct 8, 2024): You seem to mean that replaceming conhost with OpenConsole changes wsl.exe behaviour. Unfortunately, unlike previous versions, that does not work in Windows 10.
Author
Owner

@DHowett commented on GitHub (Oct 8, 2024):

wsl.exe is a Windows Console subsystem application and therefore needs to be hosted in a console.

ConPTY is the API we offer for hosting Windows Console subsystem applications.

The version of ConPTY present in Windows Terminal--which will eventually be released as part of Windows and as a separate package for people who want to host console applications1 --passes through the VT output from hosted console applications unmodified.

It, nearly by definition, changes wsl.exe's behavior when wsl.exe is hosted inside it... which is the way you are expected to host wsl.exe2 . It does not change how wsl.exe behaves when wsl.exe is not hosted using it. This is the very nature of console application hosting.

This fact is observable! If you do replace conhost.exe with OpenConsole3 even on Windows 104 , applications that use ConPTY to host wsl.exe get different output from wsl.exe.


  1. this is not the place to readjudicate our delivery mechanisms ↩︎

  2. somebody reimplemented the server side of console hosting based on our IOCTL API. it still has to handle the Win32 API components of the console API, but you might find what you need there. it is not conhost. you still need to actually use it to host an application ↩︎

  3. no warranty, either express or implied ↩︎

  4. we know this because we do it, routinely ↩︎

@DHowett commented on GitHub (Oct 8, 2024): `wsl.exe` is a Windows Console subsystem application and therefore needs to be hosted in a console. ConPTY is the API we offer for hosting Windows Console subsystem applications. The version of ConPTY present in Windows Terminal--which will eventually be released as part of Windows and as a separate package for _people who want to host console applications_[^1]--passes through the VT output from hosted console applications unmodified. It, nearly by definition, changes `wsl.exe`'s behavior when `wsl.exe` is hosted inside it... which is the way you are expected to host `wsl.exe`[^2]. It does not change how `wsl.exe` behaves when `wsl.exe` is not hosted using it. This is the very nature of console application hosting. This fact is observable! If you _do_ replace conhost.exe with OpenConsole[^3] _even on Windows 10[^4]_, applications that use ConPTY to host `wsl.exe` get different output from `wsl.exe`. [^1]: this is not the place to readjudicate our delivery mechanisms [^2]: [somebody](https://github.com/o-sdn-o) reimplemented the server side of console hosting based on our IOCTL API. it still has to handle the Win32 API components of the console API, but you might find what you need there. it is not conhost. you still need to actually _use it to host an application_ [^3]: no warranty, either express or implied [^4]: we know this because we do it, routinely
Author
Owner

@mintty commented on GitHub (Oct 8, 2024):

OpenConsole ... does not work in Windows 10.

Sorry, that was a miscarried test case. It does work. Thanks for dropping the reflow.

@mintty commented on GitHub (Oct 8, 2024): > OpenConsole ... does not work in Windows 10. Sorry, that was a miscarried test case. It does work. Thanks for dropping the reflow.
Author
Owner

@DHowett commented on GitHub (Oct 8, 2024):

Woot!

@lhecker and I have been discussing a couple other options for getting conpty fixes back to Windows 10. We'll keep the repo updated if we move forward on any of 'em...

@DHowett commented on GitHub (Oct 8, 2024): Woot! @lhecker and I have been discussing a couple other options for getting conpty fixes back to Windows 10. We'll keep the repo updated if we move forward on any of 'em...
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#7231