Hacker News new | ask | show | jobs
by wpm 1895 days ago
No. At worst it prompts you to download and install the Command Line Tools (all actionable inside the prompt; it doesn’t use the App Store) if you try to run a command not included in the OS by default like `git`.
1 comments

How is that different than what windows does with "python3"?
In fairness, annoyed though I was, the command line message you get in Windows includes directions into the settings page to disable the feature, and any others like it while you're in there.

The real surprise was mostly that python3.exe isn't included in the 3.9.x download, despite the documentation mentioning it in a few places. Since the error message didn't name drop the executable, and it appeared python was otherwise installed and working (and even available as "python" on PATH) it took some sleuthing to locate the real issue. I'm sure there's a better fix than copying "python.exe" and renaming it "python3.exe" but that worked, and I had stuff to do, so it's fine. :)

Windows doesn't present you with any actions or choices inside the command prompt. It just immediately opens the Microsoft Store to the Python 3.9 page.
It doesn't do that, if you install git in some other way (via homebrew, or manually). So it is definitely different from this:

> even after installing Python from the official website, if you happen to run a script that executes "python3" instead of "python", you'll instead trigger an unhelpful link to the Microsoft Store

The point is that python3 was already in place, and the package on the official website only created the python executable, so the stub linked to the Microsoft Store wasn't overwritten.

This is no different than macOS. If you don't overwrite the existing stubs, you get the "install xcode" message when running git or cc.

But if Apple does it, it's OK because they're the good guys.

There's no overwriting stubs in MacOS. With SIP enabled, not even root can write into /usr (the apple stub is /usr/bin/git).

Many users use git from homebrew; once you do 'brew install git', the stub won't bother you, despite homebrew not overwriting anything. It is just earlier in the $PATH. And that's the issue with Windows: the standard installer does create python3.exe, it is just later in the %PATH%, because Microsoft placed the stub in one of the early directories. Normal, well behaved installer, which places its entry at the end won't be able to override anything.

That's what I meant by overwriting: just placing it earlier in your $PATH. Overriding perhaps was a better word.