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 Terminal中实现Ubuntu风格Bash体验的用户提供了完整的操作指南。文章的优点主要体现在以下几个方面:
结构化分步教学
作者将复杂配置拆解为"安装Git Bash"、"修改默认终端"、"主题定制"等模块,每个步骤都附带代码片段和操作截图(通过链接),极大降低了用户的学习成本。特别是对JSON配置文件的逐项解释,体现了对Windows Terminal底层机制的深刻理解。
细节优化意识突出
"cursorShape": "filledBox"
和"colorScheme": "Ubuntu"
等参数的组合,精准还原Ubuntu终端的视觉体验Ctrl+V
粘贴绑定方案wt
命令快速启动的技巧,展现了对工作效率的深度考量扩展性设计合理
文末推荐PowerShell 7和第三方扩展项目,既满足了进阶用户需求,又通过GitHub链接提供了可验证的解决方案来源,体现了对技术生态的全面把握。
建议改进方向:
路径可移植性提示
文中直接使用
"C:\\Program Files\\Git\\bin\\bash.exe"
可能存在安装路径差异风险。建议补充说明用户可通过where bash
命令查询实际路径,并提示需要以管理员权限编辑settings.json
文件。视觉素材优化
目前使用图片链接展示界面效果,建议补充文字描述关键界面特征(如PowerShell默认终端的蓝色标题栏),或转为托管到图床服务以确保长期可访问性。
配置原理说明
对于
-li
参数、acrylicOpacity
等进阶配置项,可简要说明其作用机理(如-li
表示登录交互式会话,acrylicOpacity
控制亚克力透明度),帮助用户理解配置背后的逻辑。兼容性注意事项
可补充说明该配置在Windows 10 20H2及Windows 11上的验证情况,以及对Windows Subsystem for Linux(WSL)的依赖关系(尽管标题强调无需WSL,但Git Bash本质上仍依赖Git for Windows的模拟层)。
文章最大的闪光点在于将Unix-like体验的移植过程拆解为可验证的可操作步骤,这种"解构-重构"的思维方式对系统配置类写作具有重要参考价值。建议后续可考虑拓展:
整体而言,这是一篇兼具实用性和教学价值的技术指南,对提升Windows用户的生产力工具链配置能力具有积极意义。
这篇文章详细介绍了在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