Hacker News new | ask | show | jobs
by pjc50 1637 days ago
> how the Windows Console is a fundamentally different beast than a terminal

Yes, and almost entirely in ways that are bad.

I think Microsoft have partially recognised that they're tied to compatibility with a set of choices that have lost the popularity wars and now look wrong. That's why they've produced the two different sorts of WSL, each of which has awkward tradeoffs of its own. And Windows Terminal to replace the console. But eventually I think they may be forced to:

- drop \ for /

- switch CRLF to LF as the default

- provide a pty interface

- provide a C environment that uses UTF-8 by default

It's been weird working with dotnet core and seeing the "cross platform, open source" side of Microsoft, who develop in a totally different style. It's like watching a new ecosystem being built in the ruins of the old.

3 comments

> drop \ for /

API calls accept / as path separator (and interpret it correctly). Shell is a different beast though.

cmd accepts /, but you need to enclose path into quotes, otherwise it tries to interpret it as an option switch.

So you would also need to rewrite all command line utilities to use something like `ipconfig --all` instead of `ipconfig /all`.

Ah, quoting in cmd is its own kind of hell. Not so fun fact and actually the only part of Windows APIs that I truly hate (and I've worked with many of them): command-line arguments are passed to the program as a single flat string. Splitting into the argc,argv array is left to the CRT startup code.
That comes from compatibility with MS-DOS ways of dealing with arguments.
I just tested in PS and found that it eat's / as well
The PTY side has been covered for a couple of years now with the introduction of ConPTY.
The open source side of ASP.NET Core, the rest of .NET tooling has a different agenda regarding cross platform support.