
What’s New in Bash/WSL and Windows Console - yomritoyj
https://blogs.msdn.microsoft.com/commandline/2017/04/11/windows-10-creators-update-whats-new-in-bashwsl-windows-console/
======
nailer
Windows 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.

~~~
nailer
__Edit __for folks having trouble understanding: the post you 're replying to
literally mentions two of the best tabbed terminals for Windows. That's not
the problem.

A fast, inbuilt, 2017-era terminal is.

\- ConEmu has a UI that's a shotgun blast of shit.

\- Hyper still fails at basic shortcuts.

\- ConEmu plus other software still has a UI that's a shotgun blast of shit.

\- Some person's half maintained fork of putty is some person's half
maintained fork of putty and we already have Windows openssh for SSH purposes.

\- A proprietary app you need to pay for is a proprietary app you need to pay
for.

\- tmux is not a tabbed terminal.

\- Something that uses cygwin is something using cygwin.

The post is requesting a clean tabbed terminal, included in Windows, and
maintained full time by Microsoft employees (whether Open Source or
proprietary).

Edit: removed 'fully featured' as someone below thinks that means I want all
the bullshit the other terminals add, rather than tabs, working escape
sequences, and other __terminal __features.

~~~
Notre1
Out of curiosity, what tabbed terminals on other platforms would you consider
to be significantly better than ConEmu/Hyper? (I've never actually used any
GUI platform other than Windows for any length of time, so I would be
interested in seeing what other people do use.)

~~~
mikewhy
Apple Terminal, iTerm, gnome-terminal, konsole. I can't really name one worse
than ConEmu.

ConEmu likes to do this cute thing where it stops accepting key presses. And
with the all the options it has, "starting a new terminal in the directory of
the previous" is nowhere to be found.

But still, it's probably the best on Windows if you want tabs.

~~~
bitcrazed
To be fair to ConEmu, Cmder, Hyper, and all the other Windows
terminals/consoles, we don't currently provide a way for them to truly become
genuine consoles.

We're working to fix that, but we have to clean things up a little first. Bear
with us.

------
dcw303
The 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-n...](https://blogs.msdn.microsoft.com/commandline/2016/11/17/do-
not-change-linux-files-using-windows-apps-and-tools/)

~~~
mathw
It'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.

------
RegW
So 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?

~~~
filomeno
They want you not to install Linux, but keep using Windows. That way, apart
from using their OS, you may end up using the rest of Microsoft software:
Edge, Office, Outlook, OneDrive, etc. That wouldn't happen if you used Ubuntu.

What I don't understand is why Canonical thought that shrinking their user
base would be good for their business.

~~~
nxc18
This increases their user base. Every time you install WSL & Bash on Ubuntu on
Windows, you are getting a full Ubuntu distribution.

The only user base that shrinks is the Linux Kernel user base; Ubuntu and
Linux are two separate concepts, and WSL demonstrates that they are in fact
fully separable.

~~~
filomeno
Well, I always thought Ubuntu was "Linux for human beings". It seems it's now
"Bash for Windows users".

I don't think this business model will last much longer, though ;-)

------
dustinkirkland
Hats 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
And an extra personal thank you for making Byobu work so well!

~~~
zadjii
Thanks <3

------
BrandiATMuhkuh
I 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
Edit: Just updated to Ubunut 16.04 and as promised by MS all my node network
problems are gone.

------
nunez
WOW. 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
cmd 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
Isn't cmd.exe the Windows terminal emulator?

~~~
ygra
No, 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.

~~~
teh_klev
> Windows didn't have a terminal emulator until recently anyway,

Well, actually....Hyperterminal :)

[http://imgur.com/ukBjD7F](http://imgur.com/ukBjD7F)

/gets coat.

~~~
ygra
Oh, fair point. I forgot about that. But it was never intended to be used with
local console application ;-) (and ANSI.SYS goes back even further, I guess).

------
SwellJoe
Symlinks!

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.

------
struppi
Ok, 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
I 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
This is usually because, by default on many Linux flavours, the current
directory is not included in your path environment variable.

~~~
kwhitefoot
This is generally the case in all Unix shells. See, for instance,
[https://superuser.com/questions/156582/why-is-not-in-the-
pat...](https://superuser.com/questions/156582/why-is-not-in-the-path-by-
default).

------
hackpert
This is brilliant. I might actually consider switching to Windows now. Both
Arch and macOS have been getting on my nerves lately.

~~~
finchisko
Switching from Arch (linux) to emulated linux (ubuntu) under Windows makes lot
of sense. :-)

~~~
CJefferson
On my laptop, bash on windows gives me better battery life and working
sleep/wake, compared to "real" Ubuntu.

------
finchisko
>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
I'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.

~~~
cel1ne
I 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
Can you link to a bug report? dist-upgrade (as opposed to upgrade) should
remove the old packages;that's its whole point...

~~~
JdeBP
Xe 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.

------
tofflos
Windows 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.

~~~
zadjii
I 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
Actually, 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.

------
magnat
Why on that ping screenshot RTT to 127.0.0.1 is >2ms?

~~~
Svenskunganka
Don'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

------
dman
Please 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
The 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
Try 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.

------
dewitt
But 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-
bas...](https://superuser.com/questions/1088250/windows-10-linux-bash-shell-
ctrlspace-doesnt-set-mark-in-emacs)

~~~
sohkamyung
This looks like it has been fixed [1]

[1]
[https://github.com/Microsoft/BashOnWindows/issues/583](https://github.com/Microsoft/BashOnWindows/issues/583)

~~~
dewitt
Thanks!

------
fcanesin
For 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 ?).

------
lewisl9029
> 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.

------
holografix
Any news on getting Python autocomplete within VSC pointed at a virtualenv on
WSL?

------
xienze
Only 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
I 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.

------
thomastjeffery
Does 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.

------
0xFFC
Still not any option to hide that ugly scrollbar and having unlimited buffer ?
(like Gnome-Terminal)

~~~
deadbunny
The 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!

------
ygra
Wasn'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
The 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

------
averagewall
Though it says it's for developers, hopefully eventually it would be easier to
turn on so anyone can easily run command line Linux programs?

------
jjcm
As usual lovely to see headway on this. With the networking improvements I'm
hoping mosh will be supported natively. Excited to try this out.

------
dagurp
I used the "Remove & replace" method and it installed 14.04 again :/

~~~
dshanko
You 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-...](https://blogs.msdn.microsoft.com/commandline/2016/10/19/wsl-
adds-ubuntu-16-04-xenial-support/)

~~~
JorgeGT
You 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?...](https://www.microsoft.com/en-us/software-
download/windows10?tduid=\(9f4b2325f691db7c6ca018ed952a3844\)\(266696\)\(1503186\)\(44681X1528610X5b7967738258cb386b1aa2edf4662757\)\(\))

------
cwiley
I just run VcXsrv and launch gnome terminal. Works fine.

------
Gurrewe
This is great! Congrats to the team for delivering a great update!

------
nzjrs
Anyone tried deploying a linux program on windows via WSL?

~~~
skynode
I'm actually working on a deployment now. Though it's from OSX (so BSD?) to
Windows via WSL. So far so good.

------
mankash666
The interop opens up new possibilities.

------
joe563323
Cygwin works great.

------
vn0m
This is truly amazing. GG Microsoft.

------
partycoder
Bash 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%2Fba...](https://cygwin.com/cgi-bin2/package-
cat.cgi?file=x86_64%2Fbash%2Fbash-4.4.11-2)

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.

~~~
laumars
Your 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
EDIT: 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.

~~~
ohyeshedid
>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.

~~~
partycoder
Not being able to change the shell is an open issue.

[https://github.com/Microsoft/BashOnWindows/issues/846](https://github.com/Microsoft/BashOnWindows/issues/846)

Then, we both edited our replies. He corrected his typo, I removed my remark
about the typo. At no moment there was any insult given, and the replier did
not take offense.

No need for insulting.

