Live data from Hacker News

Inside the Windows Console

blogs.msdn.microsoft.com

241–250 of 259 posts

Re: Inside the Windows Console

#241

Earlier quoted context omitted.

> What exactly are backwards-compatibility goals of Windows? Are they that different from backwards-compatibility goals of POSIX systems? I can still run software written for Windows 95, without recompilation, with a pretty high success rate. As far as I'm aware, only Linux has that level of ABI compatibility and unfortunately it's completely broken by userspace. Often you can't even run the same binary on two differ…

The ABI is only part of backward compatibility. From another POV, you can run software designed for VT100 or other terminal in seventies on any Linux or Unix today, (though it may be recompiled. That legacy mentioned in previous post is that terminal is still considered serial device with specific protocol). There are companies, that do exactly that in production. You would be hard pressed to find DOS-era software th…

> You would be hard pressed to find DOS-era software that bangs on buffer starting at 0xB800:0000 that still works in 64-bit Windows.

True, though 32-bit editions of Windows still include NTVDM which runs Win16 apps!

Microsoft is pretty fanatical about backward compatibility.

Why? It's the #1 reason most enterprises and many users continue to pay to install/upgrade to Windows.

Breaking backward compatibility with existing executables (not source-code) is a violation of the trust that we've earned with customers for the last 40 years or so.

Of course, some products/features/etc. are discontinued on newer OS', etc. but the core essential platforms are rarely discontinued.

True fact: Windows still runs VB6 apps - millions of them. EVERY DAY!

Re: Inside the Windows Console

#243
post #102

Earlier quoted context omitted.

I didn't get the impression that they consider the Console API in itself a flaw. An API for this is much more robust than an in-band text API that's part of your output. For example, no Windows console application has to even think about whether printing a user-provided string can be a problem. They do note that it's an impediment for porting software to Windows, as well as the problem that the API isn't able to be i…

The most obvious problem of their design is that there's no serialisation mechanism for their API calls, so apps don't remote over low bandwidth connections. Which is one of the big advantages of terminal apps to begin with. Microsoft did objects better later on with COM and DCOM: you can imagine a better console API if COM had come first, but even then, DCOM network protocol was not good and had numerous problems th…

You're conflating two things here:

Remote Procedure Calls have many implementations. CORBA and Java implement RMI, Microsoft implemented DCOM. And for serializing API calls, they do great.

However, what's REALLY hard about remote object systems like CORBA, COM+, etc. is reliably managing object lifetime semantics. It turns out that trying to manage stateful object lifetime via an inherently unreliable network connection is tricky, if not impossible.

All the reliability semantics, security infrastructure, etc. layered on top add considerable processing cost.

By comparison sending text back and forth via networks, and/or tunneling pipes (e.g. ssh) is a piece of cake.

Re: Inside the Windows Console

#244
post #24

I tried using PowerShell or Hyper. But these are just so slow to start. So I'm always coming back to cmd.exe. It is fast and serves my basic needs just perfect. When I need more, I just type 'bash'. And bash also starts faster than PowerShell or Hyper. So I don't see why they now change WIN+X and Explorer to use PowerShell rather than cmd.exe. Keep improving cmd.exe. But please don't make it bloated.

Hi there! Author of the post that's the subject of this thread here :) Two questions: 1. Does your machine use a spinning disk for its system drive, or SSD? If the former, that's slowing you down more any anything else. STRONGLY recommend moving to SSD system drive if so. 2. Have you tried `powershell /noprofile` from Run dialog or Cmd? If you're still seeing PowerShell take > 600ms to load and start, likely somethin…

Well, re:

>1. Does your machine use a spinning disk for its system drive, or SSD?

This really shouldn't be a question regarding the performance of a terminal window.

If cmd.exe starts fast regardless, then so should Powershell if it is going to replace it.

And on that note, on a new laptop with an SSD I can see a difference between Powershell and cmd.exe execution-to-prompt-ready time (however small that latency is).

As long as that's the case, Powershell simply isn't a viable replacement for cmd.exe

Re: Inside the Windows Console

#245
post #103

Earlier quoted context omitted.

ME wasn't between the least. It was DOS based. There is no inbetween. It's either IO.SYS or NTOSKRNL.EXE. It made using the real mode MS DOS even worse by shipping a special MS DOS which skipped CONFIG.SYS and AUTOEXEC.BAT, hidden the files and removed DOS from the boot menu. To fix this, check http://retrosystemsrevival.blogspot.com/2018/06/dos-for-wind... this -- quite new blog post, just last month, for something…

Actually, no - Windows ME did not depend on MS-DOS. For all the bad rap it got (some of which was deserved), ME bypassed real-mode MS-DOS (and its config files) at bootup, and loaded its own protected-mode drivers, etc. in IO.SYS. It also loaded the main registry hive only once, and parallelized PnP resolution, significantly improving boot-up time. It also incorporated Windows 2000's networking stack, and added suppo…

Erm, nope. IFSMGR.VXD depends on IFSHLP.SYS still.

Everyone's favorite error message: the Microsoft Installable File System Manager cannot find the helper driver. Please ensure that IFSHLP.SYS has been installed.

This means Windows ME needs a real mode DOS helper for certain file system operations.

I can't remember whether the INT 21h function 55h (Create PSP) was still called as frequently as in earlier Windows and handled in DOS but I betcha.

Re: Inside the Windows Console

#246

Earlier quoted context omitted.

Hi there! Author of the post that's the subject of this thread here :) Two questions: 1. Does your machine use a spinning disk for its system drive, or SSD? If the former, that's slowing you down more any anything else. STRONGLY recommend moving to SSD system drive if so. 2. Have you tried `powershell /noprofile` from Run dialog or Cmd? If you're still seeing PowerShell take > 600ms to load and start, likely somethin…

Well, re: >1. Does your machine use a spinning disk for its system drive, or SSD? This really shouldn't be a question regarding the performance of a terminal window . If cmd.exe starts fast regardless, then so should Powershell if it is going to replace it. And on that note, on a new laptop with an SSD I can see a difference between Powershell and cmd.exe execution-to-prompt-ready time (however small that latency is)…

I am not comparing performance of a terminal window - Cmd and PowerShell both run connected to the same terminal app - Windows Console (conhost.exe) as discussed ad nauseum in the posts that are the subject of this thread.

But you're comparing a 30+ year old command-line shell that was built in 1989 to primarily provide compatibility with MS-DOS, with a modern object-based shell that runs atop the .NET CLR and provides VASTLY more power and capability than the MUCH older, simpler, shell that it supersedes.

It's like comparing startup perf of Notepad and VSCode … and saying that you won't use VSCode until it starts up as quickly as Notepad, even if VSCode saves you HOURS more per day/week than using Notepad would.

Re: Inside the Windows Console

#247
post #245

Earlier quoted context omitted.

Actually, no - Windows ME did not depend on MS-DOS. For all the bad rap it got (some of which was deserved), ME bypassed real-mode MS-DOS (and its config files) at bootup, and loaded its own protected-mode drivers, etc. in IO.SYS. It also loaded the main registry hive only once, and parallelized PnP resolution, significantly improving boot-up time. It also incorporated Windows 2000's networking stack, and added suppo…

Erm, nope. IFSMGR.VXD depends on IFSHLP.SYS still. Everyone's favorite error message: the Microsoft Installable File System Manager cannot find the helper driver. Please ensure that IFSHLP.SYS has been installed. This means Windows ME needs a real mode DOS helper for certain file system operations. I can't remember whether the INT 21h function 55h (Create PSP) was still called as frequently as in earlier Windows and…

IFSHLP.SYS was originally created during the implementation of OS/2 1.2, and later released in Windows 3.11 running on 32-bit 386 Enhanced Mode.

Its job was to provide 32-bit file access (bypassing 16-bit DOS file IO mechanisms), and ensuring nothing else on the system could intercept INT 21h calls.

ME didn't depend on MS-DOS (though it did provide support for running MS-DOS apps).

Re: Inside the Windows Console

#248

Earlier quoted context omitted.

There was a few points the other raised which I disagreed with and that was one of them. I completely agree with you that shell history should be managed by the shell itself. I also didn't agree with the points about Console API. I mean sure, he's right that ANSI / VT escape sequences are naff, but they are the standard so we're stuck with them. However as much as I love the idea of a Console API, the fact that they…

Hey Laumars - Console PM and author of the post here: Fair points in part, though … Remember that things like Remote Desktop obviated the pressing need for command-line --> remote command-line access for many years. RDP quickly evolved into a very efficient way of remoting the entire desktop experience, not just Command-Line - something that was particularly necessary until PowerShell started to mature due to Windows…

Hi, thank you for taking the time to respond.

Re the command line arguments being a single string, this is what I'm referring to:

> For better or for worse1, Windows knows about only one command line string for each process. Because one string is not terribly useful, libraries conspire to provide the illusion of multiple command line arguments: before creating a subprocess, a program combines all argument strings into one command line string, and the newly-born subprocess, before calling main, splits this string into arguments and passes the arguments as argv. In principle, each program can parse the command line string differently, but most use the convetion that CommandLineToArgvW and the Microsoft C library understand. This convention is a good one because it provides a way to encode any command line argument as part of a command line string without losing information.

> The problem is that there is no ArgvToCommandLineW. How do we construct an argument string understood by CommandLineToArgvW?

Source https://blogs.msdn.microsoft.com/twistylittlepassagesallalik...

Having one command line string is passable if you only handle ASCII characters and consider whitespace a delimiter (as was the case in the days of DOS). But the moment you start needing to pass more complex data (as you often need to when you start writing shell scripts) then you quickly run into pain points.

Another drawback of a single string is you then limit the usefulness of writing alternative languages which are heavily exec orientated (shell languages). This is a particular pain point I've experienced with my own custom shell because I apply escaping rules to quotes and allow for other methods of quotations (such as proper support for nested quotes). However since Linux / UNIX treat all parameters as an array at all points in the stack it means I can consistently parse my own languages syntax and reliably pass that to the program I'm wishing to call. It means I can drop a variable as a parameter without having to manually escape / quote it for fear of whitespaces breaking the syntax (ie using variables like you would in "normal" language). But that simply does not translate well to Windows.

And finally there is also the painpoint that not all Windows CLI tools read from ARGV. Some don't even decode the single string parameter correctly. Theres better articles demonstrating this point so I won't waste more page space on this issue but suffice to say its a bit of a mess.

Re OOP explosion: I get the point you're making but all language paradigms have experienced a similar explosion in That time frame. Be it functional, logical, object oriented, etc. I get the need to emphasize the logic of Windows as an object oriented OS (a point I don't disagree with myself) but I just feel your example was a little overreacting - to the extent that you started undermining the crux of the point you were attempting to make.

Much like how your points about UNIX "everything is a file" was somewhat mislead. That didn't really become a thing until much later in UNIX's history (Plan 9 - UNIXs successor - really pioneered that concept and many ideas were then backported. Eg The /proc example you used isnt even available on UNIX as it's Linux specific. Plus your example was really more a reporting tool than a demonstration of file system objects. Theres better examples of your point in /proc such as the PIDs and their runtime parameters, and kernel setting that can be read and written to as a filesystem objects).

Re GUI Vs console. My point was really more about how if Microsoft were dependant on the console anyway to have made it their first GUI application then it's a great pity they did such a bodge job of it. I get that RDP was a necessity anyway - and it's fair to say the performance of RDP is really quite impressive - but back in the 90s I seem to recall most Windows shops still used to just throw a physical keyboard and mouse into their racks (usually via KVM) rather than deal with RDP. Where as "Unix" (BSD, Solaris, whatever) would be wired up via serial on the machines console port for remote access. So for the best will in the world, remote access still wasn't a popular choice on NT until it's relatively recent history where as it was the main way of interacting with UNIX-like systems from the get go. And that is my problem with how NT was designed. I can take or leave the whole GUI Vs command line debate - that's purely personal opinion. My issue was until network speeds etc all really caught up, Windows made it painful to work remotely. To an extent it still does as you have to wait for the damned RDP service to come up after a reboot (which would take half an hour after the reboot had finished on one Windows domain controller I used to manage) where as on Solaris / BSD / Linux / etc I can stream it's boot process from the moment the boot menu loads (in fact I've even installed Linux remotely via serial). Obviously we all now have OOB management tools like ilo or their respective cloud management tools so the shortcomings of the RDP service are somewhat mitigated there these days but how many years of NTs history has it taken us to get to that point where a _server_ no longer needs a physical monitor, keyboard and mouse wired up to it?

All in all it was an interesting read, even if I didn't agree with some of the specific points you were making. But then life would be dull if we all agreed on everything all of the time. :)

Re: Inside the Windows Console

#249
post #106

Earlier quoted context omitted.

With the recent surge in MSFT, it must be pretty gratifying for the stock options.

The recent surge? A dev getting a bunch of shares in 1988 would have been filthy rich by 1996, already :)

I don't think any of those devs stayed past 2000.

Re: Inside the Windows Console

#250
post #228
post #216

I'm late to the party, but maybe the console guys are still lurking. If so, than first and foremost I wanted to thank you for the amazing walk you guys took the console so far. That said, as someone who uses your product for hours on daily basis, I have two pain points that I would love to have fixed, if that possible at all: 1. selection of text and deletion - works in PowerShell, doesn't work in cmd. Is this curabl…

I think rich (@bitcrazed) already talked a bit about #1, so I'll share a bit on #2. I agree, the current properties story is INSANE. I don't get how whoever wrote it even came up with it - it's likely a frankencode system that we're stuck supporting for now. I can't tell you how many times I've had to explain how the console settings work, and how your settings can be different depending on how you launch the console…

That's look promising. Thank you very much!
Post reply on HN