19 ms·
What’s New in Bash/WSL and Windows Console
- jjcm 10y agoAs usual lovely to see headway on this. With the networking improvements I'm hoping mosh will be supported natively. Excited to try this out.
- partycoder 10y agoBash for Windows... Bash is a Unix shell. Linux is an operating system. Completely different concepts. Bash on Windows has existed for decades now, through Cygwin. https://cygwin.com/cgi-bin2/package-cat.cgi?file=x86_64%2Fbash%2Fbash-4.4.11-2 https://cygwin.com/cgi-bin2/package-cat.cgi?file=x86_64%2Fba... Trying to reduce the entire GNU/Linux ecosystem to "Bash" is insulting to the community you are trying to appeal to: Linux is an immensely large and complex project, which has millions of lines of code. The GNU part of GNU/Linux has a couple of more millions of lines of code as well. Bash is small in comparison.
- aerovistae 10y agoMicrosoft adds this amazing set of features and the only response you have is "your name is insulting the people you're trying to appeal to"? "Trying"? As if they're failing? Do you know how much people love this project?
- partycoder 10y agoYour opinion is clearly not biased at all Mr. "aerovistae". Your handle sounds like a mixture of https://en.wikipedia.org/wiki/Windows_Aero https://en.wikipedia.org/wiki/Windows_Aero and https://en.wikipedia.org/wiki/Windows_Vista https://en.wikipedia.org/wiki/Windows_Vista. A true, unbiased non-MS fan. Are you on Microsoft's payroll? Do you have like a Slac-- Skype Teams room where you coordinate the downvotes?
- laumars 10y agoA lot of resistance some will have to WSL will be old battle scars from Microsofts past behaviour. Microsoft have done a lot over the years to troll the Linux community. While many of the younger HN members will be familiar with the "new open source Microsoft" some of us oldies have had to endure IE breaking the web plus ActiveX / Silverlight and other MS web lockins. Comments like "open source is communism" from top MS execs. Fragmentation of Java (which eventually spawned into .NET but there were years of pain before .NET became a thing of beauty). To be honest more sins than i have time to list. So many of us are now cynical by default with regards to MS. Take WSL for example, I'm sure their motives are just to encourage people away from Linux and OSX for sysadmin and dev workstations. I can see that strategy working for many people too. But at least with WSL, if they do decide to cripple it once they have the customer base then it's pretty trivial for users to switch away again (which was less doable with many of the other tech they've dominated the market place with). So while the trolling remarks of the OP are clearly unconstructive, i can at least emphasise with why he feels the need to speak out against MS. He just did so in a pretty lousy way.
- flukus 10y ago> A lot of resistance some will have to WSL will be old battle scars from Microsofts past behaviour. I'm also not convinced they've changed at all when I see what they've done to things like skype, where they have somewhat of a monopoly (thanks to office).
- fragmede 10y agoOr more recently, Microsoft's refusal to remove "curl" from Powershell, where "curl" was an alias to a totally different Windows function that barely resembled curl. https://news.ycombinator.com/item?id=12319670 https://news.ycombinator.com/item?id=12319670
- lloeki 10y ago> at least with WSL, if they do decide to cripple it once they have the customer base then it's pretty trivial for users to switch away again Now that they're embracing the typical Linux userland, I can't help but ponder if they'll try shifting to the extend+extinguish part later on. I guess old habits die hard, especially when you got burnt multiple times already, although I'm not cynical enough to think this would be all planned beforehand but more like at some point some exec would notice this as a strategic opportunity to seize. That said they're certainly winning some Linux users back, and if anything, this may even help in getting some Windows people used to Unix and Bash, reducing the gap for them to try their hand at some Linux distro. All in all, cross-pollination is good both ways.
- laumars 10y agoYour entry point to WSL is bash and while you may be able to compile and install other shells, calling it "bash" isn't too far from the truth. Really the awkwardness of the naming is more of a testament to the power of scripting on Unix-like OSs (eg how scripting is a first class citizen and how most of the ecosystem is modelled around CLI, and thus scripting, support) more than it is an insult. As for cygwin, that was simply terrible. MinGW was better but WSL is already better than both and it's still a long way from feature parity. Of course some MS haters will always find a way to fault this, and i can sympathise with that point too because I've been burnt my MS too and thus, as much as i found WSL to be a much needed addition to Windows, I'm still going to stick with Linux as my primary OS. However personal biases of Windows aside, even i have to admit that WSL is a pretty good feature.
- partycoder 10y agoEDIT: Your choice of shell can be something different than bash... you opt to use zsh or fish or another shell. Therefore saying "Bash for Windows" can be objectively said to be unnecessarily confusing/inaccurate. I think Cygwin was less convenient than an ABI such as WSL, but by no means "terrible". Cygwin was initially released around 1995, it served a valuable purpose before the first VM products came along.
- mankash666 10y agoI am amazed that you started at all. Given your fascination with personal attacks
- laumars 10y agoTyping on a phone. autopredict errors happen and I usually miss at least one of them since my proof reading skills suck. Apologies for that
- ohyeshedid 10y ago>EDIT: Your choice of shell can be something different than >bash... Bash is the default shell. It's also the generic command you run to launch the WSL environment. While the multiple names for the same subsystem are a little nebulous, Bash is far from being as confusing or misleading as you're attempting to portray. Also, editing your original snide grammar dismissal due to the downvotes it received isn't appreciated. That's deceptive at best. Either own your bad behavior or apologize for it, but don't edit it and pretend like you were being rational.
- vesinisa 10y ago^ Don't feed the troll.
- ghshephard 10y agoFor anybody comes to this thread late - partycoder is 100% correct. The Bash.exe component of Bash/WSL is entirely unrelated to the bash shell (that gets executed inside the WSL subsystem) - should have been named wsl.exe. Microsoft is just trying to ride (mostly successfully) for free on all of Bash's goodwill. I will note, that Microsoft, when referring to their WSL component, never refers to it as Bash - and always "Bash/WSL" - though it's dubious as to whether that's even meaningful (unless they are trying to say once you start WSL you can run bash. But you can also run fish. Or any other shell.
- struppi 10y agoOk, this is awesome, if everything works as advertised. I have been mostly a Linux user for quite some time - at least on my own computer, clients always have Windows. But this year I bought a Surface Pro as a secondary device. I first evaluated WSL and really liked it, but I switched to Hyper+Git Bash because networking in node.js was not working properly, and because I could not start Windows programs from the command line. Now, if both problems are really fixed now, I guess I will switch back to WSL, and maybe uninstall Hyper+Git Bash later (given that I do not find any other show stoppers)...
- Osiris 10y agoI recently tried starting Windows CLI programs from within bash and it worked just fine, but you have to specify the entire filename, like "./notepad.exe".
- nsebban 10y agoThis is usually because, by default on many Linux flavours, the current directory is not included in your path environment variable.
- kwhitefoot 10y agoThis is generally the case in all Unix shells. See, for instance, https://superuser.com/questions/156582/why-is-not-in-the-path-by-default https://superuser.com/questions/156582/why-is-not-in-the-pat....
- vic-traill 10y agoJust to note that this (to run scripts/executables you must specify the cwd in the cli invocation)is also the case for PowerShell. So, not unknown in the Windows world.
- JdeBP 10y agoActually, given what Osiris appears to be getting at, it is because Unix shells in general have no notion of a PATHEXT system, and so do not go around tacking .COM, .CMD, .EXE, and the like onto the ends of command names. The not searching the current directory is well known in the Unix and Linux world; and to be fair so too is the idea that if the filename of one's executable Perl script ends in .pl, or the filename of one's executable shell script ends in .sh, then the .pl and the .sh have to be explicit in the command name that one types. The idea that one can run notepad.exe with just notepad comes very much from the DOS and Windows world, here. The Windows NT POSIX Subsystem actually provided a whole bunch of shims so that one could run various Win32 housekeeping utilities from a POSIX shell without explicitly adding ".exe", and a Korn shell adjustment to allow case-insensitive searches for Win32 commands. * https://technet.microsoft.com/en-gb/library/bb463210.aspx https://technet.microsoft.com/en-gb/library/bb463210.aspx
- deleted 10y ago[deleted]
- vn0m 10y agoThis is truly amazing. GG Microsoft.
- xienze 10y agoOnly thing I wish they could do is make calling Linux programs from Windows a bit more natural. Yeah "bash -c" works, but it's not exactly ideal.
- cpdt 10y agoI made a small project back when WSL was new to help tackle this, called Slinky: https://github.com/cpdt/slinky/ https://github.com/cpdt/slinky/ It allows you to run a command in the Windows prompt to 'link' a Linux command to a Windows one, allowing you to run the Windows command to run the Linux command (if that makes sense; the GIF in the Readme is probably better at explaining). It's written in Bash and Batch so doesn't require external dependencies.
- skynode 10y agoI think it's fine as is just so you even know/remember where you're running that command from. What's not exactly ideal is completely blurring the lines between both kernel syscalls.
- sratner 10y agoYou could always: C:\> doskey ls=bash.exe -c "ls $*" C:\> ls / bin cache dev home lib media opt root sbin srv tmp var boot data etc init lib64 mnt proc run snap sys usr
- dcw303 10y agoThe inotify implementation looks very promising! Editing source files in a Windows-native IDE and having changes picked up by, say, node.js is a great workflow. I'm yet to try it out, but I wonder if the problems with editing files in the linux filesystem[0] is going to be an issue with this? [0]: https://blogs.msdn.microsoft.com/commandline/2016/11/17/do-not-change-linux-files-using-windows-apps-and-tools/ https://blogs.msdn.microsoft.com/commandline/2016/11/17/do-n...
- sterex 10y agoI tried it and it works just fine. Changes from WSL(vim) and windows IDE were picked up correctly by nodemon.
- mathw 10y agoIt's all fine if the files you're sharing are in the Windows filesystem. If they're in the Linux filesystem the same restrictions still apply.
- deleted 10y ago[deleted]
- nailer 10y agoMicrosoft: I suspect this blog post is out of date and that, post creators update, this is now safe. If so, maybe you want to edit it?
- nol13 10y agoWait so you CAN edit linux filesystem files with windows tools now? That was the main tripping point for me last time I tried out the WSL workflow. Mainly just because a bunch of files in our repo were apparently named in an ntfs unfriendly manner, so when I tried to merge etc. the repo would get corrupted.
- WorldMaker 10y agoThe impression I get is that whether or not it works depends on the particular Windows tool. The guidance and the blog post not to do it seems to be the best general advice. My understanding is that the unspoken assumption between the lines is that you may be able to find Windows tools that are well-behaved and will not corrupt things, but don't expect to find that many because alternate streams and complicated metadata are not things most Windows tool developers have had need to understand/deal with/round-trip to date.
- mankash666 10y agoThe interop opens up new possibilities.
- finchisko 10y ago>Upgrade In-Place ...though this may not result in an optimal instance. Wondering why such a disclaimer? Ubuntu apt upgrades are reliable. Or is it related to WSL? Anyway good job WSL team.
- NickGerleman 10y agoI've definitely had issues doing an upgrade on a real Ubuntu installation. Years ago I needed to update a more or less clean install of Ubuntu Desktop. It managed to completely break Gnome somehow (This was before Unity). I'm guessing things are better now and that the server distribution is better for this but I could see complications happening.
- reacweb 10y agoAfter a major change of desktop like a switch from gnome 2 to unity or gnome 3, it is not surprising that users may need to refresh their configuration files. I am doing dist-upgrade since 2009. They were all smooth except the upgrade to 16.04 (lost of network and a couple of small issues still not fixed).
- cel1ne 10y agoI used Ubuntu Server LTS a couple of times. The 14.04 version which is supported until 2019 still has the bug that it won't clear out old kernels after upgrading them. So if you don't look into your /boot partition now and then it fills up and breaks your installation.
- anoother 10y agoCan you link to a bug report? dist-upgrade (as opposed to upgrade) should remove the old packages;that's its whole point...
- JdeBP 10y agoXe could hyperlink you to Dustin Kirkland's call for feedback here on Hacker News only a short while ago, where this subject came up several times. This is a well-known Ubuntu problem, and M. Kirkland xyrself said that taking purge-old-kernels out of the byobu package and putting it somewhere more obvious was a good idea. * https://news.ycombinator.com/item?id=14002821 https://news.ycombinator.com/item?id=14002821 Of course, this is an Ubuntu upgrade problem relating to Linux. It is specifically about kernel image files. So it has very little application to the Windows NT Linux Subsystem, which as we know uses the Windows NT kernel.
- dewitt 10y agoBut did they fix ctrl-space? [1] As an emacs user, this single issue has been the show-stopper that prevented me from investing in bash on windows, even though I would like to. [1] https://superuser.com/questions/1088250/windows-10-linux-bash-shell-ctrlspace-doesnt-set-mark-in-emacs https://superuser.com/questions/1088250/windows-10-linux-bas...
- sohkamyung 10y agoThis looks like it has been fixed [1] [1] https://github.com/Microsoft/BashOnWindows/issues/583 https://github.com/Microsoft/BashOnWindows/issues/583
- dewitt 10y agoThanks!
- softwarelimits 10y agowhy is news about that windows "operating system" here on "hacker" news? is this paid content?
- magnat 10y agoWhy on that ping screenshot RTT to 127.0.0.1 is >2ms?
- Svenskunganka 10y agoDon't know, probably some VM testing on their part but I just upgraded to Creators Update and here's my result: rtt min/avg/max/mdev = 0.098/0.109/0.131/0.012 ms
- ygra 10y agoWasn't mouse support in the console for decades as well? At least it has worked in Far for ages. Or is just the integration with Linux console applications new?
- _wmd 10y agoThe console only recently (<2 years I think) learned to speak ANSI/xterm-ish escapes, Linux mouse support requires quite a few of those and doubtlessly the model differs sufficiently from however the NT console API mouse worked to require effort to support
- nzjrs 10y agoAnyone tried deploying a linux program on windows via WSL?
- skynode 10y agoI'm actually working on a deployment now. Though it's from OSX (so BSD?) to Windows via WSL. So far so good.
- SwellJoe 10y agoSymlinks! Windows has always been such a pain in the ass with regard to symlinks (my revision control workflow for big projects spread across multiple repos always includes symlinks). So, this is cool.
- holografix 10y agoAny news on getting Python autocomplete within VSC pointed at a virtualenv on WSL?
- 0xFFC 10y agoStill not any option to hide that ugly scrollbar and having unlimited buffer ? (like Gnome-Terminal)
- SebiH 10y agoYou can hide the scrollbar with ConEmu, not sure about unlimited buffer though
- deadbunny 10y agoThe windows terminal is utter garbage compared to linux ones, but to be fair the linux ones have had rather longer to hone their products. Hopefully the Microsoft guys will keep on improving!
- nunez 10y agoI usually start sshd and use KiTTY to access WSL.
- Gurrewe 10y agoThis is great! Congrats to the team for delivering a great update!
- dustinkirkland 10y agoHats off to Rich, Russ, and the entire WSL team at Microsoft. Another excellent release. Your work here bringing Ubuntu and the open source world to the Windows ecosystem makes us very, VERY proud!
- dustinkirkland 10y agoAnd an extra personal thank you for making Byobu work so well!
- zadjii 10y agoThanks <3
- BrandiATMuhkuh 10y agoI have switched to WSL pretty exactly a month ago after using solely Ubuntu for about 6 years. So far it works like a charm. The only small problem i have had was the network interface problem with nodejs (which should be solved with the new WSL). But that can be circumvented by simply running node.exe instead. The reason for the switch was: windows in great for everything UI, bash is great for everything development.
- BrandiATMuhkuh 10y agoEdit: Just updated to Ubunut 16.04 and as promised by MS all my node network problems are gone.
- hackpert 10y agoThis is brilliant. I might actually consider switching to Windows now. Both Arch and macOS have been getting on my nerves lately.
- finchisko 10y agoSwitching from Arch (linux) to emulated linux (ubuntu) under Windows makes lot of sense. :-)
- CJefferson 10y agoOn my laptop, bash on windows gives me better battery life and working sleep/wake, compared to "real" Ubuntu.
- nailer 10y agoWindows Console folk: any chance of tabs in the official terminal? Current Windows terminal options: - ConEmu: mainly excellent but a little dated - eg, the active tab color is hard to distinguish but it can't be changed, apparently due to maintainer's insistence it works on Windows XP. - Hyper: excellent but Ctrl C, Ctrl R etc broken in powershell. Adding tabs to the Windows console makes more sense than have a third party create an entire console just to support tabs.
- uaaa 10y agoThis is a more modern wrapper around ConEmu: http://cmder.net http://cmder.net
- nailer 10y agoCmder is ConEmu, just with a bunch of other stuff added to the download, including: - Something called 'git-for-windows' which isn't actually git for Windows https://git-scm.com/download/win https://git-scm.com/download/win but unremarkable things like shell additions which give you git status in the prompt, and a not-particularly-good GUI. - Clink (which is for cmd.exe). I.e., this doesn't in any way address the limitations mentioned in the post you're replying to.
- neilsimp1 10y agoDoesn't it, though? It lets you create tabs, Ctrl+c - Ctrl+v, and works for Cmd, PowerShell, and Bash on Windows.
- zouhair 10y agoConEmu does that
- nailer 10y ago> > - ConEmu: mainly excellent but a little dated - eg, the active tab color is hard to distinguish but it can't be changed, apparently due to maintainer's insistence it works on Windows XP. > It lets you create tabs, Ctrl+c - Ctrl+v, and works for Cmd, PowerShell, and Bash Not sure why you think that's addressing this.
- nunez 10y agoWOW. cmd can actually parse escape codes now AND run Linux scripts! What a time to be alive. I've been using WSL for the last year now on my Surface Pro 4, and it has been nothing short of fantastic. This bridges a HUGE gap that made the MacBook attractive.
- ygra 10y agocmd has nothing to do with it. Just as bash has nothing to do with parsing terminal escape sequences. It's a shell. On Unix-likes a terminal or ~ emulator will handle those escape sequences, on Windows it's the console (provided by conhost). What program you run in the console (or terminal) is completely irrelevant.
- Sir_Cmpwn 10y agoIsn't cmd.exe the Windows terminal emulator?
- ygra 10y agoNo, conhost.exe is (since Vista, prior to that it was a part of csrss). cmd.exe is simply the default command-line shell. To disprove your guess here, you can just observe the processes existing when running console applications. There's one conhost for each console window, but unless you run cmd, there'll be no cmd instances. Windows didn't have a terminal emulator until recently anyway, as Windows console applications use the console APIs to change cursor position, color, etc. instead of having that API as part of the text stream that's output by applications.
- RegW 10y agoSo what is the end game with WSL? What is it that MS is actually trying to do? I remember the NT POSIX subsystem, which was a bit of a joke. It was badly limited and just seemed to be a box ticking exercise to get past some government requirements (disclaimer: I don't actually know if that's true). Whatever the reason, we ended up having to port our POSIX software to NT because customers insisted it was POSIX complient. I did resent MS for the mess we got into. I do believe MS has changed. They don't seem to be the conniving organisation they once were, but what does WSL bring to Windows? Perhaps, they are just accepting that there is something inevitable about all that Linux software that is available out there, and Linux developers could now be supporting Windows with no actual effort. After all Apple have saved themselves a load of effort by using Netbsd. However, something makes me wary. Could we be looking at an attempt to replace the Linux kernal on the servers of the world?
- tectec 10y agoMy theory is that the next version of Windows is going to use the Linux kernel. They can keep Windows 10 going for a few years yet (maybe up to 5?). That will give them time to work on cross-platform .NET, so new development will be an easy switch, and good quality Win32 emulation, which will be built someway on the work done on Wine.
- lightbyte 10y ago>My theory is that the next version of Windows is going to use the Linux kernel. Windows 10 is the last version of Windows that Microsoft is making. It will be continuously updated instead of new versions being released.
- rattler 10y agoI find it very hard to believe that 10 the last version of windows.
- lightbyte 10y agoYou don't have to believe it, that doesn't change the fact that Microsoft has been saying it for two years though: http://www.theverge.com/2015/5/7/8568473/windows-10-last-version-of-windows http://www.theverge.com/2015/5/7/8568473/windows-10-last-ver...
- fcanesin 10y agoFor me Microsoft has realized that their profit on cloud (where Linux is dominant) can be significantly higher then licensing Windows, so they are pushing for a better Linux experience on the user desktop and we will see in a couple of years the Microsoft Linux Server (maybe they will buy Cannonical for that ?).
- averagewall 10y agoThough it says it's for developers, hopefully eventually it would be easier to turn on so anyone can easily run command line Linux programs?
- dagurp 10y agoI used the "Remove & replace" method and it installed 14.04 again :/
- dshanko 10y agoYou must have Windows Insider build to currently download 16.04. See details in the comments section of the blog post: https://blogs.msdn.microsoft.com/commandline/2016/10/19/wsl-adds-ubuntu-16-04-xenial-support/ https://blogs.msdn.microsoft.com/commandline/2016/10/19/wsl-...
- JorgeGT 10y agoYou can obtain the Creators Update with the latest WSL without joining the insider program, just run the Creators Update assistant: https://www.microsoft.com/en-us/software-download/windows10?tduid=(9f4b2325f691db7c6ca018ed952a3844)(266696)(1503186)(44681X1528610X5b7967738258cb386b1aa2edf4662757)() https://www.microsoft.com/en-us/software-download/windows10?...
- Bedon292 10y agoDid you install the Windows 10 Creators Update yet? I forced the Creators Update, and did the Remove & Replace, and it worked like a charm.
- joe563323 10y agoCygwin works great.
- tofflos 10y agoWindows Console question here! :) Are there any plans to support GNU Readline shortcuts such as history searching with Ctrl-R directly in the Windows Console? I'm mostly using WSL to run the PostgreSQL CLI with the standard keyboard behavior. It would be nice to be able to do that without having to install WSL.
- hibbelig 10y agoIf you run PowerShell, then PSReadline will give you a similar editing experience in PowerShell. I believe that PSReadline is built into the PowerShell that's part of Windows 10.
- zadjii 10y agoI would say that's not very high on our backlog. That sounds like something that we'd need to implement directly in cmd.exe (the shell), not conhost.exe (the terminal) and changing cmd's behavior is VERY HARD to do without somehow breaking the world.
- JdeBP 10y agoActually, command line editing and history recall for such programs is in the console. That's where the actual mechanism of DOSKEY lives. That's where history recall lives, governed by SetConsoleHistoryInfo(). One can of course write command interpreters that have their own editing systems, rather than use the one provided by the console. JP Software has done this for many years. * https://jpsoft.com/help/index.htm?cmdhist.htm https://jpsoft.com/help/index.htm?cmdhist.htm But tofflos is asking about improving the one that is in the console.
- sratner 10y agoIn the meantime, clink (https://github.com/mridgers/clink https://github.com/mridgers/clink) works well. It stays out of your way, and isn't clunky like the full shell replacements. I had even forgotten that cmd.exe doesn't do ctrl-r out of the box.
- dman 10y agoPlease disable file notified hooks for files in WSL. One of the big reasons why I prefer to work on linux in office like environments is because Symantec etc heavily hook file IO on windows making things like compilation / checkout very slow compared to linux. When WSL came out I was hoping it would sidestep the slow hooked IO problem in windows but some investigation revealed that file modified / created hooks are still triggered for files in WSL. Any change of this being removed?
- mwfunk 10y agoThe problem is the antivirus software, not the kernel features that the AV software is using. I can't imagine that MS would cripple their OS just so that someone who mostly uses WSL can bypass the AV software that their sadistic IT people force them to use. The only solution there is to just not take jobs where someone can force you to use such machines.
- dman 10y agoTry creating a lot of small files, even microsofts own antivirus (which seems to be the most light weight of the anti virus alternatives) adds significant overhead. I know its not a simple problem, but since most large repos contain a lot of small files this does create a negative "workstation os" image for windows in my mind.
- lewisl9029 10y ago> In Windows 10 Creators Update, you can now launch Windows apps & tools from within Bash … Can anyone verify if this means you can run the Docker for Windows client (the docker and docker-compose executables, not the engine) from within WSL, including from shell scripts? If so, I can't wait to try it out, since that's about the last thing preventing me from using my usual Linux/MacOS dev workflow in Windows! Unfortunately I'm running an Enterprise version of Windows, and the upgrade tool doesn't support Enterprise yet, so I'll probably have to wait for it to come through Windows Update.
- thomastjeffery 10y agoDoes that mean I can change the font without editing the registry now? Now that there is 24-bit color, is there actually a reasonable way to change the colorscheme, or are you still stuck with the same UI? As far as I can tell, this is the first major overhaul of CMD. Full stop. We've been waiting.
- cwiley 10y agoI just run VcXsrv and launch gnome terminal. Works fine.