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:
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