设置终端为 Gitbash
用惯了 Linux 终端的命令,Windows 的 shell 真的太不顺手了,但是 Gitbash 很多命令相似,可以将默认的 shell 换成 Gitbash。
打开settings.json
配置文件,添加如下
"terminal.integrated.profiles.windows": {
"PowerShell -NoProfile": {
"source": "PowerShell",
"args": [
"-NoProfile"
]
},
"Git-Bash": {
"path": "D:\\Software\\Git\\bin\\bash.exe", //bin路径下的bash,不是git-bash.exe。否则会打开外部窗口
"args": []
}
},
"terminal.integrated.defaultProfile.windows": "Git-Bash",
修改终端配色
打开Base16 Terminal Colors for Visual Studio Code,选择一款配置复制
打开 VScodesettings.json
,替换如下
"workbench.colorCustomizations": {
"terminal.background":"#1C2023",
"terminal.foreground":"#C7CCD1",
"terminalCursor.background":"#C7CCD1",
"terminalCursor.foreground":"#C7CCD1",
"terminal.ansiBlack":"#1C2023",
"terminal.ansiBlue":"#AE95C7",
"terminal.ansiBrightBlack":"#747C84",
"terminal.ansiBrightBlue":"#AE95C7",
"terminal.ansiBrightCyan":"#95AEC7",
"terminal.ansiBrightGreen":"#95C7AE",
"terminal.ansiBrightMagenta":"#C795AE",
"terminal.ansiBrightRed":"#C7AE95",
"terminal.ansiBrightWhite":"#F3F4F5",
"terminal.ansiBrightYellow":"#AEC795",
"terminal.ansiCyan":"#95AEC7",
"terminal.ansiGreen":"#95C7AE",
"terminal.ansiMagenta":"#C795AE",
"terminal.ansiRed":"#C7AE95",
"terminal.ansiWhite":"#C7CCD1",
"terminal.ansiYellow":"#AEC795"
},
修改后效果
修改终端字体
方法一:打开 VScodesettings.json
,加上下面这个配置,字体改成自己电脑上的字体
"terminal.integrated.fontFamily": "JetBrains Mono",
方法二:打开设置页面,搜索terminal font
修改后的效果
解决中文乱码
git config --global core.quotepath false