Scott Hanselman

Installing Fish Shell on Ubuntu on Windows 10

April 9, '16 Comments [36] Posted in Linux | Open Source | Win10
Sponsored By

So hopefully by now you've heard that you can run Bash via Ubuntu on Windows...and not in a VM. You can run the Bash Shell and real ELF Linux Binaries (this is not emulation) on Windows 10.

I've recorded a 30 min video with developers from the project and there's a blog post from Dustin from Ubuntu about HOW this works if you want more technical details. You should also check out the Command Line Blog and subscribe and head over to User Voice to help pick the next features.

It's beta, but it's super fun. A common question is "hey bash is lovely but what about _____ shell." Right now as I understand it supports bash and adding other shells may not work, and if it does, you're hacking around. So, let's hack around.

I noticed this shell called Fish Shell and noticed that Ruby Nealon had Fish tweaked and running. I asked for some more detail and they were happy to oblige with a medium post. Thanks Ruby!

Let me give it a try.

Add the Fish Apt Repo and install.

I headed over to the fish site and did this.

sudo apt-add-repository ppa:fish-shell/release-2
sudo apt-get update
sudo apt-get install fish

Oh, and I also changed my Console Font to use Ubuntu Mono because

Note: I'm hearing it will be WAY easier to add new fonts as the console continues improving. The conhost.exe stuff improves console for everyone, including cmd.exe, powershell.exe, and bash. That console work includes VT100, ANSI, and other stuff, and is separate, but complementary to the bash work.

Nice font.

Bash on Ubuntu on Windows - Cats and Dogs Living Together Mass Hysteria

Because we're still launching bash, we need to use the .bashrc today to launch fish, so you'll need to add ssh-agent fish, and exit to your .bashrc if you want to try this.

OK, next, kind of unrelated to fish, but still useful, I wanted to setup git and ssh-agent, so I generate a new key, add it to ssh agent, following these guides.

Theming Fish

Ruby also points out that Fish has a "Oh My Fish" framework for packages and themes. You can get it easily:

curl -L https://github.com/oh-my-fish/oh-my-fish/raw/master/bin/install | fish
omf help

Ruby also included their own fish_prompt.sh file here for the "chain" theme that I installed with "omf install chain" as some glyphs rendered weird. If you want unicode characters like → in your prompt, make sure your files are UTF-8 and not ANSI or you'll get squares!

Now my prompt uses fish, has cool auto complete, nice colors, shows the git dirty bit and branch.

image

Yes, I realize there are literally fiftyleven billion ways to customize bash, zsh, and lots of other shells to do much cooler stuff than this. I too, am old, and I to have used *nix for years. But it was fun and easy to get fish running on Ubuntu on Windows. Thanks Ruby!


Sponsor: Quality instrumentation is critical for modern applications. Seq helps .NET teams make sense of complex, asynchronous, and distributed apps on-premises or in the cloud. Learn more about structured logging and try Seq free for 30 days at https://getseq.net.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb
Saturday, 09 April 2016 08:21:13 UTC
Scott, I've never heard of Fish Shell, but it looks fun.

Speaking of Bash on Windows, do you think more people may re-discover it as a programming language in its own right? It can be so much more concise + quick than writing in a regular 'language' check out my comparison.. I'd be interested to know if it runs on your Windows/Linux?

Node.js vs Bash - coding challenge by RaspberryPi.org
Saturday, 09 April 2016 09:15:43 UTC
Scott,

Do you know what to do when you mess up the Ubuntu environment? Is there a way to reset the root filesystem (redownloading and extracting the root filesystem like the first time)? I've tried to reset it by turning off and on the Windows feature, by deleting the lxss folder. Nothing works by far.
Michael Chou
Saturday, 09 April 2016 09:26:16 UTC
I found the solution myself. There's a lxrun command you can use in cmd.exe.
lxrun /uninstall /full then lxrun /install. Now you have a new root filesystem.
Michael Chou
Saturday, 09 April 2016 10:09:56 UTC
Bash on Windows is definitely da bomb!... Microsoft should have done this in the first place instead of Powershell.
Rosdi
Saturday, 09 April 2016 10:36:57 UTC
Now we need tabs!
Rich
Saturday, 09 April 2016 10:48:07 UTC
This is great news for the fish and fisherman community! Thank you Scott.
Saturday, 09 April 2016 11:55:44 UTC
fish actually comes with it's own configurator that can be accessed by doing "fish_config" which will generate an html settings page that could be accessed by going to "%UserProfile%\appdata\local\lxss\root\.cache\fish"
Saturday, 09 April 2016 12:29:05 UTC
Agree with @Rossi we need tab badly...
Then we'll have superpower Linux machine on Windows 10
Reski
Saturday, 09 April 2016 15:59:35 UTC
Scott,

Do you think it is wise to introduce new bash users to a shell that is bash incompatible? From my experience, working with fish is frustrating for anything remotely complex. Much time will be wasted on why some script the user found online isn't working due to fish's bash incompatibilities. You might want to mention this in your post to warn users.
Saturday, 09 April 2016 16:57:15 UTC
@ScottSchecter

Please give fish another chance. fish is different from bash, absolutely, but this is not incidental, this is by design. fish was not design to follow POSIX and that was on purpose. Are you familiar with fish design principles[1]? This is a must read even if you are just a shell dilettante as it explains fish's vision and reason to exist.

I am sure your experience is absolutely valuable and I am sorry you encountered only problems, but from *my* experience working with fish, I report success.

I don't know if my projects count as complex, but I have a handful of fish open source up on GitHub that hopefully can demo this shell's power and scope as well as its limitations; fisherman[2] and the fishery[3], etc.


[1]: fishshell.com/docs/current/design.html
[2]: https://github.com/fisherman/fisherman
[3]: https://github.com/fishery
Saturday, 09 April 2016 18:53:16 UTC
Thanks a lot for this!

Could you kindly give us some hints on how to add the Ubuntu Mono font to Powershell/Bash?
James P
Sunday, 10 April 2016 08:35:10 UTC
@James P

Adding fonts to your console is something that has to do with the terminal application, not with your shell. Check your terminal application settings and look for a setting that let you select the font you want.

Make sure to download the powerline[1] fonts first.

[1]: https://github.com/powerline/fonts
Sunday, 10 April 2016 12:04:33 UTC
@James P

If you follow Scott's link for the Consolas font, it will tell you how to change the font in the windows console. It will lead you here

https://support.microsoft.com/en-us/kb/247815

I have a slightly different issue, I can't change the keyboard layout in bash to match my own, anyone know?
Niclas Lindgren
Monday, 11 April 2016 19:09:03 UTC
I prefer tcsh but when configuring the default shell, what about the change shell command?

chsh -s /bin/fish

Once you log out and back in, you can run the following to determine your default shell was updated.

ps -p $$
chsh
Tuesday, 12 April 2016 01:14:26 UTC
Thanks for the cool info. I agree, bash should have been in windows from the start. heh.
Michael McShane
Tuesday, 12 April 2016 11:40:03 UTC
Great Post... nice
Tuesday, 12 April 2016 11:40:03 UTC
Great Post... nice
Thursday, 14 April 2016 16:09:21 UTC
Hi Scott

My console is acting weirdly. If I open Properties and change the font to Ubuntu Mono (which worked on the retail Windows 10 before I installed the Insider Build) it doesn't actually change. Open properties again and it's still on Consolas. I can change to Lucidia, but not Ubuntu Mono (I get the same thing on my PowerShell console, even though it did work on the retail Windows 10). Also, if I set the windows size in the Properties or Defaults dialog, the setting is ignored (it always opens a really small window of the same size every time).

Any ideas?
Friday, 15 April 2016 06:30:47 UTC
nice post man
Monday, 18 April 2016 14:33:18 UTC
nice one to read thanks for sharing with us
Monday, 18 April 2016 14:34:16 UTC
Thanks for the cool info. I agree, bash should have been in windows from the start.
Tuesday, 19 April 2016 04:40:39 UTC
Thanks For Providing Awesome Content...
Saturday, 23 April 2016 22:09:13 UTC
For anyone wondering why all the links to gists are 404s - the name changed from rubymeow to rubylust, the working links are:

https://gist.github.com/rubylust/6afcfa384b2b5489be7a3863fa3dd2f3
https://gist.github.com/rubylust/49f0d8fb3375321d98801490776c0138
Wednesday, 27 April 2016 06:45:33 UTC
Wonderful article, very useful and well explanation. Your post is extremely incredible
Saturday, 30 April 2016 10:24:30 UTC
The Article is awesome,very nice to read and understand and your postings are also nice.
Saturday, 30 April 2016 10:26:12 UTC
How did you get such an informative information to express in your postings.
Saturday, 30 April 2016 10:28:25 UTC
Nice One to read and understand thanks for sharing this article with all us.Continue Postings like this articles.
Wednesday, 04 May 2016 06:42:31 UTC
Nice!!
Thursday, 05 May 2016 22:01:44 UTC
Nice and thanks alot
Saturday, 07 May 2016 07:17:31 UTC
Thanks for sharing this informative article with us.
Sunday, 15 May 2016 16:22:06 UTC
Awesome post.
Friday, 27 May 2016 19:35:58 UTC
thanks a lot or sharing! Free Android APK file download safe link apkdom best safe APK downloader free download mirror xapk obb server CoC private link. Love fun ideas lovematchfun join now. The Best Prank Apps, jokes and shocking Games for Android. prankyapps electric screen joke, Love Match test Prank, transparent screen android app, etc. Free Android app APK download softlot app games APK downloader. Gift Ideas giftspilot gifts for her and kids. Cheers!
fredt
Wednesday, 01 June 2016 06:34:16 UTC
very nice share, thanks.
Sunday, 12 June 2016 05:07:51 UTC
Nice and so helpful for all the people.
Sunday, 12 June 2016 05:09:30 UTC
So helpful.Thank you so much for this article continue postings.
Sunday, 03 July 2016 18:11:46 UTC
Thanks buddy for giving such an awesome stuff.
Comments are closed.

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.