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.
因此,希望现在您已经听说可以在Windows上而不是在VM中通过Ubuntu运行Bash。 您可以在Windows 10上运行Bash Shell和实际的ELF Linux Binaries(这不是仿真)。
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.
我已经与该项目的开发人员录制了30分钟的视频, Ubuntu的Dustin撰写了一篇博客文章,介绍如何在需要更多技术细节的情况下如何使用。 您还应该查看命令行博客并订阅并转到User Voice,以帮助选择下一个功能。
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.
它是Beta版,但超级有趣。 一个常见的问题是“嘿bash很可爱,但是_____ shell呢?” 目前,据我了解,它支持bash,添加其他shell可能无法正常工作,如果可以,那么您正在四处寻找。 所以,让我们四处寻找。
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!
我注意到这个名为Fish Shell的外壳,并且注意到Ruby Nealon对Fish进行了调整和运行。 我要求提供更多细节,他们乐于接受中级职位。 谢谢露比!
Let me give it a try.
让我尝试一下。
添加Fish Apt Repo并安装。 (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
哦,我也将控制台字体更改为使用Ubuntu Mono,因为
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.
注意:我听说随着控制台的不断改进,添加新字体会更加容易。 conhost.exe可以改善所有人的控制台,包括cmd.exe,powershell.exe和bash。 该控制台工作包括VT100,ANSI和其他内容,并且是单独的,但与bash工作互补。
Nice font.
不错的字体。
![Bash on Ubuntu on Windows - Cats and Dogs Living Together Mass Hysteria Bash on Ubuntu on Windows - Cats and Dogs Living Together Mass Hysteria](https://i-blog.csdnimg.cn/blog_migrate/1064a60028243c0d9fa84100179c961c.png)
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.
因为我们仍在启动bash,所以今天我们需要使用.bashrc来启动fish,因此您需要添加ssh-agent fish,然后如果要尝试执行此操作,则退出到.bashrc 。
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.
好的,接下来,与鱼无关,但仍然有用,我想设置git和ssh-agent,因此我按照这些指南生成一个新密钥,并将其添加到ssh agent中。
Then go into GitHub and add your key https://github.com/settings/ssh. There isn't xclip support yet, but you can just cat ~/.ssh/id_rsa.pub for now.
然后进入GitHub并添加密钥https://github.com/settings/ssh 。 目前尚不支持xclip,但您现在只能使用〜/ .ssh / id_rsa.pub。
主题鱼 (Theming Fish)
Ruby also points out that Fish has a "Oh My Fish" framework for packages and themes. You can get it easily:
Ruby还指出,Fish具有用于包和主题的“ Oh My Fish ”框架。 您可以轻松获得它:
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!
Ruby在此处还包含了自己的fish_prompt.sh文件,用于“链”主题,该主题是我通过“ omf install chain”安装的,因为一些字形变得怪异。 如果您在提示符下想要→之类的unicode字符,请确保您的文件是UTF-8而不是ANSI,否则您将得到平方!
Now my prompt uses fish, has cool auto complete, nice colors, shows the git dirty bit and branch.
现在我的提示使用鱼,具有很酷的自动完成功能,漂亮的颜色,显示git脏位和分支。
![image image](https://i-blog.csdnimg.cn/blog_migrate/7183f2f11d3826a8e9e1808f60e65de7.png)
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!
是的,我意识到实际上有五百亿种方法可以自定义bash,zsh和许多其他shell,以完成比这更酷的工作。 我也很老,我已经使用* nix多年了。 但是让鱼在Windows的Ubuntu上运行很有趣且容易。 谢谢露比!
翻译自: https://www.hanselman.com/blog/installing-fish-shell-on-ubuntu-on-windows-10