打开 profiles.json 配置文件
打开Windows Terminal,点击设置,可以看到,复制增加一组ssh配置,然后修改三个地方。
{
// Make changes here to the powershell.exe profile.
"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"name": "Windows PowerShell",
"commandline": "powershell.exe",
"hidden": false
},
修改guid
利用powershell可以生成guid
powershell -Command "[guid]::NewGuid().ToString()"
修改名字
任意,可以是系统名字,IP,用户名等,如 username@aliyun-bj
修改commandline
ssh -i C:\user\username\id_rsa username@aliyun-bj
其中i参数后面为证书存放位置,如果试用密码登录可以不填
完整SSH支持(图标,配色等)
{
"acrylicOpacity" : 1,
"closeOnExit" : true,
"colorScheme" : "One Half Dark",
"commandline" : "ssh username@aliyun-bj",
"cursorColor" : "#FFFFFF",
"cursorShape" : "bar",
"fontFace" : "Consolas",
"fontSize" : 14,
"guid" : "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"historySize" : 9001,
"icon" : "ms-appx:///ProfileIcons/{9acb9455-ca41-5af7-950f-6bca1bc9722f}.png",
"name" : "username@aliyun-bj",
"padding" : "0, 0, 0, 0",
"snapOnInput" : true,
"startingDirectory" : "",
"useAcrylic" : false
}
支持Git-bash
{
"guid": "{7f0152b2-c491-4bb6-8a87-610352d630c8}",
"acrylicOpacity" :1,
"closeOnExit" : true,
"colorScheme" : "Campbell",
"commandline" : "\"%PROGRAMFILES%\\Git\\Bin\\bash.exe\" -i -l",
"cursorColor" : "#FFFFFF",
"cursorShape" : "bar",
"fontFace" : "Consolas",
"fontSize" : 14,
"historySize" : 9001,
"icon" : "%PROGRAMFILES%\\Git\\mingw64\\share\\git\\git-for-windows.ico",
"name" : "Git-bash",
"padding" : "0, 0, 0, 0",
"snapOnInput" : true,
"startingDirectory" : "%USERPROFILE%",
"useAcrylic" : true
}
WSL
{
"guid": "{2c4de342-38b7-51cf-b940-2309a097f518}",
"hidden": false,
"name": "Ubuntu",
"source": "Windows.Terminal.Wsl"
},
msys2
{
"guid": "{17da3cac-b318-431e-8a3e-7fcdefe6d114}",
"name": "MINGW64 / MSYS2",
"commandline": "C:/msys64/msys2_shell.cmd -defterm -here -no-start -mingw64",
"startingDirectory": "C:/msys64/home/%USERNAME%",
"icon": "C:/msys64/mingw64.ico",
"fontFace": "Lucida Console",
"fontSize": 9
},
{
"guid": "{2d51fdc4-a03b-4efe-81bc-722b7f6f3820}",
"name": "MINGW32 / MSYS2",
"commandline": "C:/msys64/msys2_shell.cmd -defterm -here -no-start -mingw32",
"startingDirectory": "C:/msys64/home/%USERNAME%",
"icon": "C:/msys64/mingw32.ico",
"fontFace": "Lucida Console",
"fontSize": 9
},
{
"guid": "{71160544-14d8-4194-af25-d05feeac7233}",
"name": "MSYS / MSYS2",
"commandline": "C:/msys64/msys2_shell.cmd -defterm -here -no-start -msys",
"startingDirectory": "C:/msys64/home/%USERNAME%",
"icon": "C:/msys64/msys2.ico",
"fontFace": "Lucida Console",
"fontSize": 9
}
参考