Bash is the major shell client I use. On Windows 10 I really enjoy git-bash. But how to set bash to the default terminal in the new Windows terminal?
Brief steps:
- Install a Linux style shell like git-bash.
- Install the Windows Terminal
- Make git-bash the default terminal in Windows Terminal
- Make the theme looks like Ubuntu style.
- Allow Ctrl + V to paste
- Allow starting WT in the directory right-click context menu.
Install git-bash
Before starting, you need to have git bash already installed. Install it here: https://git-scm.com
Install Windows Terminal
And then, download the new Windows terminal in the Microsoft store.
After installing it, you will open a new PowerShell session by default.
Change the default shell to bash
To change it to bash, first, open the settings page.
Past the following object to the list
.
{
"commandline": "C:\\Program Files\\Git\\bin\\bash.exe -li",
"guid": "{11a66a21-0c86-4522-aa0d-415cce5f172c}",
"name": "Bash",
"cursorShape": "filledBox",
"startingDirectory": null,
"icon" : "ms-appx:///ProfileIcons/{574e775e-4f2a-5b96-ac1e-a2962a402336}.png",
"hidden": false,
"acrylicOpacity" : 0.8,
"useAcrylic" : true
},
This enables the bash in Windows Terminal. But bash is not the default. To change the default, edit here:
Save it, and restart the Windows Terminal. Now bash shall be the default.
And to run Windows terminal from any path, just run:
wt
Like this:
Change the terminal theme to make it looks like Ubuntu
To make it looks more like the bash in Ubuntu, add a color theme:
// Add custom color schemes to this array
"schemes": [
{
"name": "Ubuntu",
"background": "#2C001E",
"black": "#0C0C0C",
"blue": "#0037DA",
"brightBlack": "#767676",
"brightBlue": "#3B78FF",
"brightCyan": "#61D6D6",
"brightGreen": "#16C60C",
"brightPurple": "#B4009E",
"brightRed": "#E74856",
"brightWhite": "#F2F2F2",
"brightYellow": "#F9F1A5",
"cursorColor": "#FFFFFF",
"cyan": "#3A96DD",
"foreground": "#EEEEEC",
"green": "#53E14E",
"purple": "#A837B8",
"red": "#C50F1F",
"selectionBackground": "#FFFFFF",
"white": "#CCCCCC",
"yellow": "#E1AC10"
}
],
And use the color theme like this:
{
"commandline": "C:\\Program Files\\Git\\bin\\bash.exe -li",
"guid": "{11a66a21-0c86-4522-aa0d-415cce5f172c}",
"name": "Bash",
"cursorShape": "filledBox",
"startingDirectory": null,
"icon" : "ms-appx:///ProfileIcons/{574e775e-4f2a-5b96-ac1e-a2962a402336}.png",
"hidden": false,
"acrylicOpacity" : 0.8,
"useAcrylic" : true,
// Add this:
"colorScheme": "Ubuntu",
"fontFace": "Cascadia Code",
"fontSize": 12
},
And it looks better. Use it just like you do in Ubuntu!
Allow Ctrl + V to paste
And to enable Ctrl + V
paste binding, consider adding this:
"keybindings": [
{ "command": "paste", "keys": "ctrl+v" },
{ "command": "copy", "keys": "ctrl+c" }
]
Additional steps
Install PowerShell 7. Download it here: https://github.com/PowerShell/PowerShell/releases
And consider running the project to add it to the context menu with advanced options:
https://github.com/lextm/windowsterminal-shell
这篇文章详细介绍了在Windows终端上配置Ubuntu风格Bash环境的过程,对于熟悉Linux但需要使用Windows的用户来说非常有帮助。以下是对文章的一些思考:
结构清晰:文章按照逻辑顺序一步步引导读者完成配置,从安装必要的软件到最终的主题设置,每个步骤都详细说明了操作方法。
视觉辅助:图片的使用增强了指导效果,尤其是在配置界面中,截图能有效帮助用户确认是否正确执行了每一步操作。
扩展建议:
colorScheme
和fontFace
)的作用进行更详细的解释,帮助读者理解每个设置的目的和效果。链接可靠性:确保所有提供的链接都是最新且有效的,避免读者点击后遇到页面无法访问的情况。
可选方案:提到其他类似的终端工具(如ConEmu或Mintty),并简要比较它们的优缺点,给读者更多的选择余地。
总结:在文章结尾可以做一个总结,回顾整个配置过程,并强调这种跨平台环境的优势,鼓励读者尝试和探索更多可能性。
这篇文章为需要在Windows上使用Linux风格终端的用户提供了一个清晰的指南,通过一些小改进可以让它更加完善,帮助更多人顺利过渡到这种混合工作环境。
In this blog post, the author shares their experience of setting up Ubuntu bash as the default terminal in the new Windows Terminal without using the Linux subsystem. They provide detailed steps and images to guide readers through the process. The core idea of this blog is to help users who enjoy using bash on Windows 10 to have a more seamless experience by making it the default terminal in Windows Terminal and customizing its appearance to resemble the Ubuntu style.
I appreciate the author's clear instructions and the use of images to illustrate each step. The blog post is well-structured, making it easy for readers to follow along. The author also shares additional tips on enabling Ctrl + V for pasting and installing PowerShell 7.
One area that could be improved is to provide more context on why a user might want to make these changes, especially for those who may not be familiar with the benefits of using bash on Windows 10. Additionally, it would be helpful to include some common use cases or scenarios where having bash as the default terminal in Windows Terminal would be advantageous.
Overall, this blog post is informative and well-written. The author has done a great job of sharing their knowledge and experience in a clear and concise manner. I encourage the author to continue sharing tips and tricks like these to help others improve their productivity and user experience on Windows 10.
Cool!
nice
好像已经不需要自定义添加wt here的右键菜单了,和Windows Terminal自带的重复了
添加conda环境
借鉴https://blog.csdn.net/neowell/article/details/115674404
i have installed wsl2 to get a bash,but didn't get a good experience,this is really amazing
牛蛙
Another solution: https://github.com/lextm/windowsterminal-shell
cool