首先从该地址git clone,或者直接下载zip包:
https://github.com/git-for-windows/git-sdk-64
如果下载的zip, 下载完后解压,我是解压系统盘根目录下
c:\git-sdk-64
从win10应用商店下载Windows terminal预览版,从开始菜单启动,或者 win + R
输入 wt
点击标题栏的向下的小箭头打开配置文件profiles.json
将下面的代码copy到配置文件profiles
属性中
{
"acrylicOpacity": 0.9,
"closeOnExit": true,
"colorScheme": "Campbell",
"commandline": "C:\\git-sdk-64\\usr\\bin\\bash.exe --login -i", //修改为你的解压目录
"cursorColor": "#FFFFFF",
"cursorShape": "emptyBox",
"fontFace": "Consolas",
"fontSize": 11,
"guid": "{1c4de343-38b7-51cf-b940-2309a097f518}", //guid随便填,只要和其他的不重复就可以
"icon": "C:\\git-sdk-64\\mingw64\\share\\git\\git-for-windows.ico",
"name": "Git-Sdk-64",
"padding": "8, 8, 8, 8",
"snapOnInput": true,
"startingDirectory": "C:\\Users\\xxx", //终端启动路径,不设置该项会默认进入system32
"useAcrylic": true
},
然后在全局globals
中设置该属性"defaultProfile": "{1c4de343-38b7-51cf-b940-2309a097f518}" //默认要加载的终端guid
Done!
打开设置,在settings.json
中加入下列代码:
"terminal.integrated.shell.windows": "C:\\git-sdk-64\\usr\\bin\\bash.exe",
"terminal.integrated.shellArgs.windows": ["--login"]
附上我自己的配置文件
settings.json
{
"C_Cpp.updateChannel": "Insiders",
"files.autoGuessEncoding": true,
"vsicons.dontShowNewVersionMessage": true,
"python.jediEnabled": false,
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
"workbench.startupEditor": "newUntitledFile",
"window.zoomLevel": 0,
"workbench.colorTheme": "Night Owl",
"explorer.confirmDelete": false,
"window.menuBarVisibility": "default",
"terminal.integrated.shell.windows": "C:\\git-sdk-64\\usr\\bin\\bash.exe",
"terminal.integrated.shellArgs.windows": ["--login"]
}
profiles.json
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
//"defaultProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"globals": {
"alwaysShowTabs": true,
"copyOnSelect": false,
"defaultProfile": "{1c4de343-38b7-51cf-b940-2309a097f518}",
"initialCols": 120,
"initialRows": 30,
"requestedTheme": "system",
"showTabsInTitlebar": true,
"showTerminalTitleInTitlebar": true,
"wordDelimiters": " ./\\()\"'-:,.;<>~!@#$%^&*|+=[]{}~?\u2502",
"useAcrylic": true
},
"profiles": [
{
// Make changes here to the powershell.exe profile
"acrylicOpacity": 0.5,
"closeOnExit": true,
"colorScheme": "Campbell",
"fontFace": "Consola",
"useAcrylic": true,
"background": "#012456",
"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"name": "Windows PowerShell",
"commandline": "powershell.exe",
"hidden": false
},
{
// Make changes here to the cmd.exe profile
"acrylicOpacity": 0.5,
//"backgroundImage": "D:\\31239\\Pictures\\203420xo3ljwf7jl7jby1l.jpg",
//"backgroundImageOpacity": 0.75,
//"backgroundImageStretchMode": "fill",
"closeOnExit": true,
"colorScheme": "Campbell",
//"colorScheme": "Solarized Dark",
"cursorColor": "#F0E68C",
"cursorShape": "emptyBox",
"fontFace": "DejaVu Sans Mono",
"useAcrylic": false,
"snapOnInput": true,
"startingDirectory": "%USERPROFILE%",
"guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
"name": "cmd",
"commandline": "cmd.exe",
"hidden": false
},
{
"guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}",
"hidden": false,
"name": "Azure Cloud Shell",
"source": "Windows.Terminal.Azure"
},
{
"acrylicOpacity": 0.5,
"closeOnExit": true,
"colorScheme": "Ubuntu",
"cursorColor": "#FFFFFF",
"cursorShape": "filledBox",
"useAcrylic": true,
"guid": "{2c4de342-38b7-51cf-b940-2309a097f518}",
"hidden": false,
"name": "Ubuntu",
//"startingDirectory": "/home",
"source": "Windows.Terminal.Wsl"
},
{
"acrylicOpacity": 0.5,
"closeOnExit": true,
"colorScheme": "Solarized Dark",
"commandline": "C:\\Program Files (x86)\\Git\\bin\\bash.exe",
"cursorColor": "#FFFFFF",
"cursorShape": "emptyBox",
"fontFace": "DejaVu Sans Mono",
"fontSize": 11,
"guid": "{1c4de342-38b7-51cf-b940-2309a097f518}",
"icon": "C:\\Program Files (x86)\\Git\\mingw32\\share\\git\\git-for-windows.ico",
"name": "Git-Bash",
"padding": "8, 8, 8, 8",
"snapOnInput": true,
"startingDirectory": "C:\\Users\\31239",
"useAcrylic": true
},
{
"acrylicOpacity": 0.9,
"closeOnExit": true,
"colorScheme": "Solarized Dark",
"commandline": "C:\\git-sdk-64\\usr\\bin\\bash.exe --login -i",
"cursorColor": "#FFFFFF",
"cursorShape": "emptyBox",
"fontFace": "Consolas",
"fontSize": 11,
"guid": "{1c4de343-38b7-51cf-b940-2309a097f518}",
"icon": "C:\\git-sdk-64\\mingw64\\share\\git\\git-for-windows.ico",
"name": "Git-Sdk-64",
"padding": "8, 8, 8, 8",
"snapOnInput": true,
"startingDirectory": "C:\\Users\\31239",
"useAcrylic": true
},
{
"acrylicOpacity": 0.9,
"closeOnExit": true,
"colorScheme": "Campbell",
"commandline": "C:\\Users\\31239\\.babun\\cygwin\\bin\\bash.exe",
"cursorColor": "#FFFFFF",
"cursorShape": "emptyBox",
"fontFace": "Monospace",
"fontSize": 11,
"guid": "{4b4de342-38b7-51cf-b940-2309a097f518}",
"icon": "D:\\31239\\Pictures\\图标\\zsh.ico",
"name": "Babun",
"padding": "8, 8, 8, 8",
"snapOnInput": true,
//"startingDirectory": "C:\\Users\\31239",
"useAcrylic": true
}
],
// Add custom color schemes to this array
"schemes": [
{
"name": "Campbell",
"foreground": "#F2F2F2",
"background": "#0C0C0C",
"colors": [
"#0C0C0C",
"#C50F1F",
"#13A10E",
"#C19C00",
"#0037DA",
"#881798",
"#3A96DD",
"#CCCCCC",
"#767676",
"#E74856",
"#16C60C",
"#F9F1A5",
"#3B78FF",
"#B4009E",
"#61D6D6",
"#F2F2F2"
]
},
{
"name": "Solarized Dark",
"foreground": "#FDF6E3",
"background": "#073642",
"colors": [
"#073642",
"#D30102",
"#859900",
"#B58900",
"#268BD2",
"#D33682",
"#2AA198",
"#EEE8D5",
"#002B36",
"#CB4B16",
"#586E75",
"#657B83",
"#839496",
"#6C71C4",
"#93A1A1",
"#FDF6E3"
]
},
{
"name": "Solarized Light",
"foreground": "#073642",
"background": "#FDF6E3",
"colors": [
"#073642",
"#D30102",
"#859900",
"#B58900",
"#268BD2",
"#D33682",
"#2AA198",
"#EEE8D5",
"#002B36",
"#CB4B16",
"#586E75",
"#657B83",
"#839496",
"#6C71C4",
"#93A1A1",
"#FDF6E3"
]
},
{
"name": "Ubuntu",
"foreground": "#EEEEEC",
"background": "#2C001E",
"colors": [
"#EEEEEC",
"#16C60C",
"#729FCF",
"#B58900",
"#268BD2",
"#D33682",
"#2AA198",
"#EEE8D5",
"#002B36",
"#CB4B16",
"#586E75",
"#657B83",
"#839496",
"#6C71C4",
"#93A1A1",
"#FDF6E3"
]
},
{
"name": "UbuntuLegit",
"foreground": "#EEEEEE",
"background": "#2C001E",
"colors": [
"#4E9A06",
"#CC0000",
"#300A24",
"#C4A000",
"#3465A4",
"#75507B",
"#06989A",
"#D3D7CF",
"#555753",
"#EF2929",
"#8AE234",
"#FCE94F",
"#729FCF",
"#AD7FA8",
"#34E2E2",
"#EEEEEE"
]
}
],
// Add any keybinding overrides to this array.
// To unbind a default keybinding, set the command to "unbound"
"keybindings": [
//{
// "command": "closeTab",
// "keys": [
// "ctrl+w"
// ]
//},
{
"command": "newTab",
"keys": [
"ctrl+t"
]
},
{
"command": "prevTab",
"keys": [
"ctrl+shift+tab"
]
},
{
"command": "nextTab",
"keys": [
"ctrl+tab"
]
},
{
"command": "switchToTab0",
"keys": [
"alt+1"
]
},
{
"command": "switchToTab1",
"keys": [
"alt+2"
]
},
{
"command": "switchToTab2",
"keys": [
"alt+3"
]
},
{
"command": "switchToTab3",
"keys": [
"alt+4"
]
},
{
"command": "switchToTab4",
"keys": [
"alt+5"
]
},
{
"command": "switchToTab5",
"keys": [
"alt+6"
]
},
{
"command": "switchToTab6",
"keys": [
"alt+7"
]
},
{
"command": "switchToTab7",
"keys": [
"alt+8"
]
},
{
"command": "switchToTab8",
"keys": [
"alt+9"
]
}
]
}