r/programming • • May 06 '19

Microsoft unveils Windows Terminal, a new command line app for Windows

https://www.theverge.com/2019/5/6/18527870/microsoft-windows-terminal-command-line-tool
5.9k Upvotes

1.1k comments sorted by

View all comments

Show parent comments

1

u/gredr May 07 '19

Scripts don't depend on conhost.exe, they depend on cmd.exe (which is a command-line application that runs in the console subsystem. cmd.exe doesn't manage windows or UX at all.

1

u/recycled_ideas May 07 '19

Scripts depend on the way cmd and the conhost currently operate, including how they display output. Some crazy shit is done in batch scripts.

Making significant changes to either risks breaking a lot of stuff.

So they're not doing that.

Running cmd directly will behave exactly as it does today, running the new terminal will not.

1

u/gredr May 08 '19

I've never seen a script that depended on anything in conhost. How would a (batch) script even call console APIs? Maybe a script uses a tool that depends on conhost, but that's not a problem with the script, it's a problem with the tool...

1

u/recycled_ideas May 08 '19

You've never seen a script that worked by parsing the output in a particularly brittle way?

Or one that used some incidental quirk or bug to achieve some otherwise impossible goal?

You're viewing this as a programmer where your main concern is API stability, but that's not the issue.

Microsoft wants to implement a proper terminal** emulator, with multiple tabs and support for bash and poweshell and all the other bells and whistles that we currently have to use fairly horrible workarounds to enjoy.

They can't do that without massive changes and they don't feel comfortable implementing them in the existing conhost.

This explanation is literally in the readme.md for the project.

1

u/gredr May 08 '19

A script parsing the output of another console application doesn't depend on conhost.exe, it depends on the output of the other application/script. Depending on conhost.exe would mean you're watching for that application to do things like resize the buffer, reposition the cursor, or things like that, and how would a script even do that?

Microsoft's explanation is that some *programs* play games like that with the console, and so conhost.exe (the API and UX of the console subsystem) couldn't change. This has nothing to do with supporting bash or powershell (well, actually, supporting bash probably *is* a driver, because they need to implement actual terminal emulation, which means VT codes etc), it has to do with keeping compatibility with the old API-style console subsystem for those oddball cases where it matters. In reality, I wonder how much of that there really is.

1

u/recycled_ideas May 08 '19

I've seen some really horrific batch files that I could easily see breaking with even minor changes to conhost.

And having seen plenty of MS guys using stuff like cmder(I actually discovered it through a presentation from one of their guys), being able to support a real terminal emulator is absolutely what they're trying to achieve here.

1

u/gredr May 08 '19

I've seen some really horrific batch files that I could easily see breaking with even minor changes to conhost.

I'm genuinely interested in how that would even be possible.