Closed be5invis closed 3 months ago
@zadjii-msft was looking into this. The main issue, if I recall correctly, is that we need to trash the entire buffer when something enters or exits “passthrough” mode. It’s also only truly applicable when there is a connected pseudoconsole session.
And the reason one console might enter and exit passthrough mode multiple times is that you may run coolNewThing.exe
from CMD, and perhaps it might launch a further process that needs legacy support.
Additional concerns: if you have a tree of four processes, each of which wants passthrough to be different, should the ones that are doing ReadConsoleOutput
be able to read the buffers from the other legacy/non-passthrough ones?
It’s complicated when you get into compatibility discussions. :smile:
Yea, I tried getting this working for like a day last year, but it's something I've wanted to work on for a while.
As Dustin mentioned, there'd be real weirdness moving between passthrough mode and non-passthrough mode. However, I think it might still be something good to investigate.
From #1985:
I've discussed this a couple times on different threads before, but I think I never made a real issue for it.
The idea of conpty passthrough mode is that a commandline client application that knows it's only going to use VT sequences (and not the API) to modify the console could set a special mode,
ENABLE_PASSTHROUGH_MODE
. If conpty is active, the console would then stop rendering itself over conpty, and anything that was written to the console would go straight to the terminal.
- This would work especially well for something like
wsl
, where it's only ever going to be talking VT.- It would not work for cmd.exe, because of cmd.exe's heavy reliance on the API.
- Windows Powershell again needs the API pretty heavily, but maybe Powershell Core, which is cross-platform, could make use of it.
This has some rough edges that need to be sorted out.
- [ ] What happens when the app exits, and passthrough mode is turned off? The terminal and conpty's buffers would not be equivalent anymore!
- I've been toying with the idea of having conpty both pass the sequences through, and also process them itself, so that the terminal and conpty stay in sync.
- [ ] What happens when someone tries to call Console API's in passthrough mode?
- I'm thinking we just cause them to fail. All save for
Get/SetConsoleMode
and reading input / writing output.- We'll also probably need to be able to read resize events.
This needs a real spec written, but it probably needs prototyping done before that.
We need a SIGWINCH
asynchronous signal for resizing somehow.
This is an essential feature for opening MS text-mode software (esp. WSL) to 3rd-party environments. The current approach seems to tighly connect the Windows terminal implementation with ConPTY, however that limits applications unnecessarily and makes them highly dependent on Windows terminal progress (which may still take years, honestly).
It would not work for cmd.exe, because of cmd.exe's heavy reliance on the API.
It should be a combined mode: Whenever a console-API-based application is run, e.g. as started from a pure terminal-based application, the console API calls should be transformed into terminal escape sequences. Note as there are not so many features in the console API, this is a much easier approach than the reverse mapping, trying to squeeze terminal features through the conhost bottleneck.
Just realized #2035 is this ask framed differently.
however that limits applications unnecessarily and makes them highly dependent on Windows terminal progress
Not just progress. Behavior. This guy is writing a Tek4010 emulator. He is going to need a PTY if say his code were ever ported to native win32. And conhost
sure as heck doesn't know what to do with the bytestream coming down that PTY. Never will. And need not care.
We need a SIGWINCH asynchronous signal for resizing somehow.
That too. Doesn't have to be a signal, mind, if there is some religious/philosophical reasons against. But if not it needs to be a separate (third rail) HANDLE
on which I can WaitForMultipleObjects()
, because no one said there is a ReadFile()
byte coming, ever.
@mintty There are many absurd console API usages, like reading the screen. That's really a legacy that ... IBM PC has a video card while PDPs aren't. One idea is that ConPTY can have a "sync" stuff to read back the screen from a console application if some console API applications want to something strange. Otherwise the console host could simply convert console API calls into VT sequence, and forward that to the terminal app.
There are many absurd console API usages, like reading the screen.
Great. Invent a new CSI sequence for that. Send the PCHAR_INFO lpBuffer
back as I dunno a base64 gzip. The feature is not supported by Mintty. Yet. No biggie. Not even unusual. Any 6502/Z80 assembler programmer working 1981 was free to add their own crazy vendor-specific sequence to their company's terminal if they were bored enough on a weekend too.
There are many absurd console API usages, like reading the screen.
Great. Invent a new CSI sequence for that.
I assume this concern is more about the other direction of such adaptation, i.e. how would you serve a Windows console program that wants to use that "absurd" feature? You could run a second, hidden console in parallel, to maintain backwards compatibility.
run a second, hidden console in parallel
The people who hate how ConPTY is implemented today will absolutely hate how it's implemented if we do that. :grin:
They wouldn't even notice in pure pass-through applications. It might be necessary to solve an otherwise unresolvable dilemma.
run a second, hidden console in parallel
This solution makes no sense because there is no window in sshd.exe
nor someoldprogram.exe
. Both those programs are text only applications that wouldn't know a Consolas Font from a hole in the ground.
To the point of #2035, neither sshd.exe
nor someoldprogram.exe
are terminal emulators. Gnome Terminal is a terminal emulator. And gnome-terminal
is the only thing that can give the correct answer as to the contents its screen buffer; ie what ReadConsoleOutput()
should return. Similarly, the only thing that knows the contents of (VS Code) xterm.js's
screen buffer is xterm.js
. ConPTY doesn't have a clue what xterm.js
internal screen buffer contains. At best it can only guess by scraping the data passing by.
I assume this concern is more about the other direction of such adaptation,
Yes. And as a practical matter I wouldn't expect the ESC[?GIVEMEBUFFERASIBM
feature being added to vteterminal anytime soon. Unless someone can point out the killer app that calls ReadConsoleOutput()
.
[a hidden window] might be necessary to solve an otherwise unresolvable dilemma.
I think we are closer than that. If conhost
wants to read-only scrape the data going by for the sole purpose of keeping a wild-ass-guess as what the actual terminal emulator's buffer looks like, sure, I can live with that. ReadConsoleOutput()
is a red herring. If conhost
(call it a urxvtd
analogy) wants to maintain a shadow buffer, it can knock itself out.
...So long as it is quiet about it. There is no reason for a pass-through "mode", which is how this issue was framed. There is never a reason for ConPTY to inject a VT sequence into a WriteFile()
on a PTY handle -- ever. Daniel over on the VS Code team can't possibly care; because he has his own terminal emulator. PTYs don't care about VT100 sequences. Never heard of them.
[Then we need SIGWINCH
(or equivalent thereof). Which isn't related to VT100 sequences or screen buffers either.]
@therealkenc,
Like it or not, conhost is the API server that, regardless of whether it presents a window, makes all existing Win32 console applications work. It must continue to make those applications work, because organizations really ~hate~ love when Microsoft rolls through with a new standard and tells everybody to drop what they're doing and throw out thousands of lines of code.
I think you're looking to turn this request, and this project, into something it's not. You may be attempting to turn CreatePseudoConsole
into something it's not, too. Things work the way they work because we need to maintain compatibility with the thirty years of applications written since the VGA text mode buffer became the "official" design inspiration for how consoles should work in DOS and Windows.
ConPTY exists to--narrowly-stated--allow an application that understands a number of sequences as specified by an xterm-256color terminfo to host a windows console application; to wit: an application that would otherwise run in conhost should be able to run in a "terminal emulator" of sufficient compatibility. It's not intended to support a TEK4010 application (those are not windows console subsystem applications), and it's not likely to want to support a TEK4010 terminal emulator that is expecting to receive a bytestream from a TEK4010 application. That guy will probably end up doing what everybody ELSE who doesn't want to write a windows console subsystem application does: use pipes, because they don't have the same compatibility requirements (neé guarantees) as the windows pseudoconsole infrastructure.
Through that lens, a "passthrough" mode is required. A console application by default, and this cannot be changed for compatibility reasons, starts up in a mode where it just has full access to all of the stupid Win32 console APIs that no terminal emulator developer wants to countenance. Nobody should be able to read back the contents of a terminal buffer, local or remote, that they wrote to. Nobody should be able to write into the offscreen section of the buffer, because there's no guarantee anywhere else that it actually exists. But, they do. Developers use this. Applications expect this, because they were written as windows console subsystem applications. A passthrough mode--mode!--is the only way we can offer an application a way to say "I promise I won't use the old ways" while still being a windows console subsystem application. That's the first step we can make towards ConPTY being the dumb pipe you want it to be.
If you'd like to debate whether the Windows Console was the right choice, or was well-designed, I'm happy to have you do it--but not here.
Two asides.
SIGWINCH
, follow #281.isatty(3)
is a libc-provided fixture, you also have openpty(3)
. When somebody spawns a child application with a stdin/stdout hooked up to file descriptors they get back from openpty(3)
, isatty(3)
suddenly returns 1. That application will, more often than not, decide that what that means is that it can send back VT100 escape sequences. That's what it means to most applications to be "on a tty." Sure, it's a terrible abstraction and a poor design and applications should be smarter than this, but they're not. The Windows Pseudoconsole fits right in, here, with the understanding that "I've allocated a PTY, which means I want VT".I'm not intending to criticize the design or implementation -- at all. That was not the intent. I am trying (more slowly than intended) to find a solution to open-for-a-year issue WSL#3279. Of which Biswa96 has a very good start.
woah this thread got pretty out of hand over the weekend.
The stars aligned Friday, and I actually got a chance to play around with implementing a passthrough mode for conpty. I'm pretty happy with how it works so far, so I think it needs a spec and some polish, and maybe we can ship it one day. Here's the approach I've been taking:
ENABLE_PASSTHROUGH_MODE
to the SetConsoleMode
flags. SetConsoleTextAttribute
is a good example.GetConsoleProcessList
).E_UNSUPPORTED_API
(or a real error) indicating that API isn't supported in passthrough mode. Case in point: ReadConsoleOutput*
, ScrollConsoleScreenBuffer
, SetConsoleDisplayMode
, etc.cmd.exe
launched wsl.exe
, and wsl
enabled passthrough, did some stuff, then wsl
exited, and cmd
restored the console back to non-passthrough mode (as it needs to use the API). When passthrough mode is exited, conpty will redraw its screen, to re-sync the terminal to what conpty believes the buffer looks like.
This provides a way where we can be sure that apps that weren't updated for running in a pty will still have access to the entire console API, but apps that want to live in the new world can say "I promise I know what I'm doing", and run even smoother in conpty. I believe there's going to be an incredibly small intersection of apps that want to use VT and also call things like ReadConsoleOutput
. Most apps are wither going to be console-like, using the API heavily, and might not be as likely to be updated for such a mode. However, for *nix-like apps that aren't going to be using the API so much and are primarily speak VT, this is an excellent option. This flag creates a clear distinction between the two when running in a pty.
This sounds like an excellent plan, and thanks for caring about mintty. From the description of the [not done yet] item, I guess even the following use case might work: A terminal runs wsl.exe through a pipe, and in the WSL session the user invokes cmd.exe...
Indeed sounds good. My points:
It seems like we can change the meaning of passthrough mode from "I won't use any of Console API" to "I won't use any of bizzare Console API functions that aren't convertible to VT or otherwise easliy handleable like GetConsoleProcessList
". The list of such functions will go to docs.microsoft.com.
Actually the passthrough mode could be assumed by default and ConPTY can be lazily enabled. So if user runs a command line program and the program starts writting text/vt (or use sane
API functions), conhost would then just pass them through and record changes, like @zadjii-msft described. But if it sudenly uses insane
API function (e.g. it's shell and it launched a program that does so), then conhost would fallback to current behaviour with ConPTY, also like described above:
When passthrough mode is exited, conpty will redraw its screen, to re-sync the terminal to what conpty believes the buffer looks like.
This would make appropriate applications work with passthrough mode without any modifications.
wsl
or alike called directly, where they will always be in passthrough mode, then conhost wouldn't need to record the state. So if the terminal launches wsl
and it says "I will ever use passthrough mode", then the terminal can say to system that he doesn't need ConPTY, becouse the app it launched will never use it. If on the other hand the terminal launches cmd
which launches wsl
it won't do that, becouse now wsl
isn't the process that he [the terminal] launched, but some child process of it.
Conhost would then just read from one pipe and pass that to other, which could be further optimised, but it would probably need to sit there to handle signal pipe.I'd like to ask about progress in this issue. Recent "WSL 2" mode (currently under evaluation in the Windows Insider program) appears to be incompatible with previous workarounds to run WSL properly from terminal environments. This makes the need for conpty passthrough mode more urgent and it would be highly appreciable to have it available before the release of WSL 2 mode into the main Windows branch.
@mintty WSL 2 doesn’t change anything about how WSL instances are hosted in consoles, so it’s very unlikely that passthrough mode would help. What specific issue are you seeing?
Without conpty, bash.exe
or wsl.exe
do not work well if connected directly to a pty or pipe. Previous wrappers like winpty
or wslbridge
work around that by running their backend in a hidden virtual console from which they grab output, poke input, mediate signal handling etc. This does not seem to work with WSL 2.
Conpty has the capability to replace this wrapping function, but it enforces its own terminal model which is not desirable in this scenario.
Previous wrappers ... work around that by running their backend in a hidden virtual console from which they ...
That 100% should still work today. Those are powered by the ReadConsoleOutput
API, which we cannot break.
WSL2 doesn't change anything about how WSL instances are hosted in consoles. Any change in behavior there is absolutely a bug that we should fix before 20H1, but this feature request isn't the appropriate place to discuss that.
Since nobody here can reproduce this particular failure, can you please file a detailed bug report on what you're seeing? What wrapper, what version of Windows, what is happening and what should be happening?
The wrapper does not actually use ReadConsoleOutput
, so maybe it's proper to still discuss that here;
it's https://github.com/rprichard/wslbridge/, called from a cygwin terminal.
Its connection to WSL seems to be based on CreatePipe
.
For the record, I prototyped passthrough mode about a month ago. I had quite a fair amount of success with it, and I felt pretty happy with the prototype. You can check out the prototype on this branch (fair warning - it's quite a bit out-of-date).
What are the next steps here?
To be 100% transparent, it's not being looked at for the 20H1 release.
Because passthrough mode is not going to be a timely solution to the WSL2 issue that @mintty mentions, we should fork a thread for that discussion, to debug and understand what's wrong.
conhost also processes the strings that a commandline app emitted. This is to try and keep conpty's state in sync. This is important for the following.
I think we should ask the CONPTY consumer to implement this -- so CONHOST could completely get rid of the character matrix in the passthrough mode. If the consumer doesn’t implement this then CONHOST should reject entering passthrough mode.
There is no standard provision for a VT application to read back the buffer. Asking a terminal emulator to handle it is asking a lot of Terminal developers. Consider that you wouldn’t be able to ssh to windows unless you were using a terminal emulator that supported readback.
(@be5invis: you are basically asking us to create a new API that will force all terminal developers to support legacy windows console behaviors. That’s just not likely to happen, and nobody would be willing to support it.)
@DHowett-MSFT Well the “new API” is one-shot: only when CONHOST switch back to traditional mode, this API would be called once to read what the current application renders. A terminal developer can choose not to implement this — and CONHOST would disable passthrough mode in this case.
@be5invis @DHowett-MSFT
I understand it this way so that conhost starts in passthrough mode by default and doesn't record changes that passes through it. If app starts to use the insane, inconvertible-to-vt API functions, then conhost asks the terminal to get its current state (like buffer) and exits passthrough mode.
If a terminal doesn't support the get current state
function, then conhost has to record the changes that passes through it, so when it eventually exits passthrough mode it is in the same state as terminal.
@be5invis : Ah, now I understand the proposal. What, for comparison, about my previous proposal to run a hidden/dummy console in parallel, so you're always prepared for this case and don't need to disable passthrough?
Hey ConPTY devs,
First, many thanks for this API, this is a huge step forward. I actually came here because I am developing my own terminal emulator, and mainly while being on my windows machine - until I realized that it was eating my VT sequences.
So I am very happy to read that there is indeed a strong motivation to implement a pass through mode.
What is actually needed for me to get my hands dirty early with this mode? As all this eating makes it basically impossible to debug my own code via ConPTY. I am not really a Win32-dev, so please go easy on me. ;)
Thanks you.
Thanks to everyone working on this! I've been hoping to see this for some time, so very excited to see progress!
Actually the passthrough mode could be assumed by default and ConPTY can be lazily enabled.
I just wanted to weigh in that passthrough-by-default seems highly desirable to me.
If I'm reading right, passthrough will result in faster and better rendering (e.g. resolves #405) more or less universally. The only downside is that it would break compatibility with some console APIs (which cross-platform VT-based apps will not need).
So it seems to me that a good balance would be:
SetConsoleMode
to explicitly enable passthrough mode. In this state, calling unsupported APIs will result in an unsupported error.SetConsoleMode
to explicitly disable passthrough mode. They might want to do this on startup so they can safely use incompatible APIs without causing a mode switch & redraw during program operation.Also some interesting questions which just struck me:
A further thought: will the hosting terminal emulators be able to query if the pseudoconsole is in passthrough mode? This might be needed, for example when the window resizes:
I think if the terminal emulators request a ConPTY and state whether or not to to get pass through mode, then the terminal emulator already knows what to do in such circumstances.
On Mon, 9 Dec 2019, 06:51 David Hewitt notifications@github.com wrote:
A further thought: will the hosting terminal emulators be able to query if the pseudoconsole is in passthrough mode? This might be needed, for example when the window resizes:
- If it is in passthrough, then the terminal emulator should perform text reflow when the window resizes
- If it is not in passthrough, then ConPTY will perfom text reflow (so the terminal emulator should not)
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/microsoft/terminal/issues/1173?email_source=notifications&email_token=AAAN3O2FBNHB5LIVP5O22FDQXXMHZA5CNFSM4HWHDMHKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGH5QDA#issuecomment-563075084, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAN3OYWW4ENVN5F3DALG4TQXXMHZANCNFSM4HWHDMHA .
I think if the terminal emulators request a ConPTY and state whether or not to to get pass through mode, then the terminal emulator already knows what to do in such circumstances.
Sure; however it sounded to me like for the solution proposed here the commandline app would request passthrough mode, rather than the terminal emulator. So the terminal emulator would have no knowledge of whether passthrough mode is enabled.
IMHO it doesn't make sense for the app (running inside a terminal emulator) to request passthrough mode but the terminal emulator, the one to interpret the VT sequences, must see the VT sequences as equivalent as possible to what the app produced. ?The problem with ConPTY is, that it is going to reimplement every single VT sequence out there, and it lags behind. Hence, terminal emulator writers where reporting bugs (or missing features), and the best way to work around that is to "just pass all VT sequences through \"as-is\"", eliminating a whole range of issues within ConPTY, and thus, giving the terminal emulator the chance to actually see what the apps produce, and render that.
The app inside any terminal emulator, while it should know when it is going to be resized, should not care about what terminal emulator of man-in-the-middle (conpty) it is running in. Do you agree?
Am Mo., 9. Dez. 2019 um 08:51 Uhr schrieb David Hewitt < notifications@github.com>:
I think if the terminal emulators request a ConPTY and state whether or not to to get pass through mode, then the terminal emulator already knows what to do in such circumstances.
Sure; however it sounded to me like for the solution proposed here the commandline app would request passthrough mode, rather than the terminal emulator. So the terminal emulator would have no knowledge of whether passthrough mode is enabled.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/microsoft/terminal/issues/1173?email_source=notifications&email_token=AAAN3OYOEQS5Q5RM5ORTTG3QXX2G7A5CNFSM4HWHDMHKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGIF25I#issuecomment-563109237, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAN3O4XF6KLNQELYXBXMJLQXX2G7ANCNFSM4HWHDMHA .
@christianparpart sometimes, there are no VT sequences coming out of an application. The Windows Console APIs are not implemented using VT sequences. The application must request passthrough mode to tell the console that it will not use one of the APIs that cannot be translated into VT sequences.
The terminal cannot set passthrough mode because it cannot force legacy applications to become compatible with VT sequences.
This is why ConPTY exists.
For a terminal, whether conhost is in ConPTY or passthrough mode should be irrelevant, because the terminal application will just receive VT sequences through the PTY pipe.
For a terminal, whether conhost is in ConPTY or passthrough mode should be irrelevant, because the terminal application will just receive VT sequences through the PTY pipe.
That's my point; it's not irrelevant in certain edge cases. For example when the window resizes: at the moment ConPTY reflows its buffer and sends the terminal emulator instructions to redraw everything. In passthrough mode this won't happen, so the terminal emulator will have to do reflow itself.
Idea: Perhaps an OSC
escape sequence could be sent by conhost to inform the terminal emulator that conhost is entering / exiting passthrough mode?
The terminal cannot set passthrough mode because it cannot force legacy applications to become compatible with VT sequences.
No, the use case is a terminal running a specific backend, particularly WSL, so it knows the client will use VT mode and passthrough is needed to give it full functionality.
... when the window resizes: at the moment ConPTY reflows its buffer and sends the terminal emulator instructions to redraw everything. In passthrough mode this won't happen, so the terminal emulator will have to do reflow itself.
The terminal would "normally" notify the pty about changed terminal size. The pty would then send a SIGWINCH signal to the client application. ConPTY should handle this signal forwarding somehow. Then the client application can redraw itself.
No, the use case is a terminal running a specific backend, particularly WSL, so it knows the client will use VT mode and passthrough is needed to give it full functionality.
I disagree. Knowledge that passthrough is needed for full functionality would be better written once in the client app (e.g. wsl.exe
) than in every terminal emulator which wants to host WSL.
The terminal would "normally" notify the pty about changed terminal size. The pty would then send a SIGWINCH signal to the client application. ConPTY should handle this signal forwarding somehow. Then the client application can redraw itself.
Agreed (I think it might already send this signal?). But I'm not talking about SIGWINCH here. I'm talking about the terminal emulator's own text layout & redraw, such as wrapping overflowing lines. At the moment ConPTY does line wrapping on its internal buffer and sends VT output to the emulator on how to draw the wrapped text. In passthrough mode the emulator will get unwrapped text and need to wrap it itself.
I started on a prototype of a flavor of passthrough mode for Fix-Hack-Learn week approximately a week or two ago.
In this prototype... I did not have the clients elect in or out. If they used VT straight on Write/ReadConsole/File... it was just plain old VT straight through to Terminal. If they used the classic APIs... I did best-effort at quick-translating them without simulating the world.
It's an attempt to be a compromise of performance and compatibility. I basically wrote thin translation layers for each of the classic Console APIs into the nearest VT sequences possible and made up answers for those that didn't have translations. It works pretty OK for CMD.exe and WSL.exe at the end of the hack. Powershell less well because it has a readline thing I need to debug out of it. But it showed promise.
I had it configured as a thing that we could let a user specify from the top in their Terminal profile so we could have it experimental to refine it over time and learn what all the edge cases are through usage.
One big thing of note is that it doesn't have wrong-way support (readback from output buffer or write to input buffer), but @zadjii-msft had an idea for at least the readback one.
I hope to put this behind a feature key and an experimental Terminal profile setting and bring it into at least the Terminal Preview and Terminal Dev branches in the next few weeks so everyone can try it and get a better idea of what it can and cannot do. Then we should be more informed on whether my idea was good... whether we need a different approach... or at least how far away we are from implementing a passthrough.
One big thing of note is that it doesn't have wrong-way support (readback from output buffer or write to input buffer), but @zadjii-msft had an idea for at least the readback one.
In short: even in passthrough mode, we maintain the buffer internally in ConPTY. We write write's out to the terminal immediately, but also queue them up to write to the internal buffer. We could process that queue on another thread or something. This would unblock the IO thread immediately, allowing for more writes, but if someone wants to read back the buffer, then we can just flush those queued writes, then reply back with the actual contents of the buffer.
Nice! So I might be able to reanimate my half-baked project to write a screen/tmux app in pure dotnet :) I had started writing it a couple of years ago before I fully understood conpty model.
I hope to put this behind a feature key and an experimental Terminal profile setting
Please don't do that magic kind of stuff. A simple API call (like the one to enable ConPTY) should be sufficient in order to faciliate seamless feature usage for applications.
Please don't do that magic kind of stuff. A simple API call (like the one to enable ConPTY) should be sufficient in order to faciliate seamless feature usage for applications.
We're actually hoping to make it more magic than that. Right now, the plan is to throw it behind the experimental setting in the Terminal, and have it apply automatically to whatever client application is connected. Hopefully, if we can get all the kinks worked out, we'll probably just get rid of the experimental setting entirely, and just have it enabled by default. Client apps won't ever need to even know that this is functionality that exists, it should just work.
That's really cool! I'd love to understand the steps required for alternative terminal implementations such as alacritty to try this out and give feedback once the initial implementation becomes available.
I hope to put this behind a feature key and an experimental Terminal profile setting
Please don't do that magic kind of stuff. A simple API call (like the one to enable ConPTY) should be sufficient in order to faciliate seamless feature usage for applications.
Terminal is a great place for us to test things that impact the console infrastructure before rolling them out to a place where they will impact the billions of daily conhost sessions. Putting something behind an experimental opt-in for Terminal isn't a statement, implicit or explicit, that it's always going to be ~there~ WT-exclusive (NOTE: edited for clarity) or that it's going to be quasi-proprietary.
We aren't fighting progress by locking people into Windows Terminal. We're not that Microsoft.
I hope to put this behind a feature key and an experimental Terminal profile setting
Please don't do that magic kind of stuff. A simple API call (like the one to enable ConPTY) should be sufficient in order to faciliate seamless feature usage for applications.
This option is still on the table depending on the outcome of the experiment. It was Fix Hack Learn week. I still don't fully understand the ramifications of all the decisions I made in this hack, so we could very well decide to make it an opt-in toggle at the end of this road.
I hope to put this behind a feature key and an experimental Terminal profile setting
Please don't do that magic kind of stuff. A simple API call (like the one to enable ConPTY) should be sufficient in order to faciliate seamless feature usage for applications.
Terminal is a great place for us to test things that impact the console infrastructure before rolling them out to a place where they will impact the billions of daily conhost sessions. Putting something behind an experimental opt-in for Terminal isn't a statement, implicit or explicit, that it's always going to be ~there~ WT-exclusive (NOTE: edited for clarity) or that it's going to be quasi-proprietary.
We aren't fighting progress by locking people into Windows Terminal. We're not that Microsoft.
Agree. I'm using Terminal Experiments as a safe space to put a change that folks can opt into, receive in a convenient GitHub or Store delivered mechanism, and provide ample feedback before we lock a full plan and ingest into Windows. We have several orders of magnitude more freedom to add/remove and deliver in the Terminal package (especially the Dev branch) than we do in Windows. There is also no set timeline for this to happen, so we're not going to rush it.
I just decided to use this to have fun on the open hack week. I want to be open and clear with everyone about what it is so they can try it out and prove me fortunately correct or terribly wrong... then go from there.
Modern apps won’t read the hidden character grid and do everything in VT. So why not an API/console mode to tell Console Host to completely throw away that?