12 ms·
Ask HN: Why hasn't anyone made a bash-like shell that directly targets Windows?
I get that some aspects of bash and friends are wrapped up in Unix/GNU/etc, but not everything. It seems like there are lots of core commands and basic interaction features, and maybe even some things like Linux-style piping, that could be replicated on Windows without bridging the entirety of the Linux system interfaces for 100% compatibility (like WSL does).
Why isn't there a native Windows shell out there that's just designed to be comfortable-enough for bash users, in the low-hanging ways?
- steverb 6y agoYou mean like https://www.cygwin.com/ https://www.cygwin.com/ ?
- brundolf 6y agoThe way Cygwin is implemented is a bit different from what I mean. My thinking is a shell that doesn't even try to be binary-compatible, it only tries to be "UI"-compatible
- tubularhells 6y agoThat makes no sense. Please try to rephrase.
- brundolf 6y agoTab-autocomplete works the same way Command-history works the same way Pipes and angle bracket operators work the same way Setting env variables inline works the same way All the familiar basic commands for getting around (cd, ls, cat, etc) are present and work the same way (same flags, same output format, etc) All the little things that trip you up when you just try and use cmd.exe to do something simple would work the way you expect them to from bash. Everything that doesn't translate falls back to the normal Windows behavior. 80% of the benefit, 20% of the effort/complexity
- tubularhells 6y agoNo idea what that would take, I haven't had the honour of working in a windows environment in a decade.
- gjvc 6y agoprobably because most "use of bash" in practice rapidly reduces to "use of a subset of the unix toolset" which doesn't exist in the same environment, so -- just the bash shell itself on its own -- would be like a fish out of water.
- brundolf 6y agoWhat about including a "busybox for windows"? Just the core utilities. Common dev tools like git and node already have command-line versions for Windows that work pretty much the same as the other versions
- xnyan 6y agoWell, now there’s WSL 1 and/or 2 depending on your needs. Once hardware GPU support goes live, there are not a ton of development software that one of those could not handle. If you want to do stuff with the windows os or applications, powershell is actually quite good and offers some real advantages over bash - for example, In powershell everything is an object, no string nonsense like bash.
- brundolf 6y agoWSL 1 attempts to bridge all of the Linux system APIs over to Windows ones. WSL 2 spins up an entire Linux VM. Both come with nontrivial compromises when it comes to interop Powershell seems like it tries to change some things up for the "better", but what I really want is something where a person who's used to Unix can just pop into Windows and hit the ground running with all the basic stuff without having to learn a "new" shell first
- clarifier123 6y agoIf we're talking about native (i.e. not using Cygwin or MSYS) shells, I believe Hamilton C Shell is the closest thing: https://hamiltonlabs.com/Cshell.htm https://hamiltonlabs.com/Cshell.htm It has some drawbacks, though, most notably lack of Unicode support.
- brundolf 6y agoThat looks like the right idea! Though unfortunately it appears to be closed-source, and the last update was in 2014
- yuppie_scum 6y agoIs this not Powershell?
- joshenders 6y agohttps://frippery.org/busybox/ https://frippery.org/busybox/
- brundolf 6y agoI'd thought this would be useful but not a complete solution, but then noticed it looks like it includes its own shell? > The BusyBox shell is based on ash. It strives to be POSIX-compatible, though it does support some features of bash. A UNIX-style shell is something like the Windows command prompt, though much more powerful. It can be used as an interactive command line or to run shell scripts (like Windows batch files, though again, much more powerful).
- rmyorston 6y agoYes. The shell in BusyBox is derived from ash via dash. They have diverged over the years but there is some flow of patches between the two. While dash aims to be POSIX-compatible the BusyBox shell includes selected bash features. The shell in the busybox-w32 port has much of the POSIX and bash goodness of upstream BusyBox. It's a native WIN32 application so there are some concepts that don't translate well. For example, job control isn't supported and signal handling is limited. On the whole, though, I think it provides a reasonably comfortable shell experience.
- sally1620 6y agoMicrosoft took this matter into their own hands and the result ended up being Powershell. In the first iteration, they just ported Korn shell to windows but it wasn't that useful. So after a couple of iterations they ended up with Powershell.
- brundolf 6y agoYeah, powershell came to mind though it's not quite the same thing (though sounds like it's closer than I thought!) I still wonder if a modern, open-source, "this is designed to make bash people comfy" shell has a place
- yuppie_scum 6y agoWith Linux Subsystem For Windows and Docker working on windows, it feels like less of a problem than back in the bad old days.
- valiant-comma 6y agoThe built-in Windows Command Shell is actually quite capable. However, syntax is rather different than *nix shells.
- ElectricMind 6y agoyou looking for this ? https://github.com/microsoft/terminal https://github.com/microsoft/terminal
- runjake 6y agoPutting aside the fact that there’s various bash implementations for Windows, Windows is not UNIX. UNIX is file-based and Windows is object-based. Windows and UNIX users/engineers tend to have vastly different philosophies. When Microsoft set out to create a new shell that rivaled bash, they came out of it with PowerShell. I think they succeeded with that, PS performance issues aside.
- the__alchemist 6y agoWindows terminal (https://www.microsoft.com/en-us/p/windows-terminal/9n0dx20hk701 https://www.microsoft.com/en-us/p/windows-terminal/9n0dx20hk...) combined with the new PowerShell is nice, and borrows syntax from Linux terminals.
- jerrygoyal 6y agowhy WSL and WSLv2 hasn't been mentioned by anyone.