1.大致明白Terminal打开终端的原理
我们看一下terminal的配置文件
{
// Make changes here to the powershell.exe profile.
"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"name": "Windows PowerShell",
"commandline": "powershell.exe",
"hidden": false,
"acrylicOpacity": 0.7,
"colorScheme": "BlulocoLight",
"useAcrylic": true
}
主要看下commandline这个参数,可以看到Terminal启动powershell时,实际就是下发了一个命令"powershell.exe"
2.自定义一个配置制作一个终端
复制一个powershell配置出来,然后自己去网上找个guid生成工具生成一个新的id
比如,我这里想做一个ssh的终端,专门用来连接我的服务器。
{
// Make changes here to the powershell.exe profile.
"guid": "{87650182-7063-41ED-B1F3-1B5711C49DC9}",
"name": "10.200.1.122",
"commandline": "ssh 10.200.1.122 -l root",
"hidden": false,
"acrylicOpacity": 0.7,
"colorScheme": "BlulocoLight",
"icon": "C:/Users/Pictures/ubuntu-icon.png",
"useAcrylic": true
}
效果如下:
上面主要改了guid、name、commandline和icon。icon这个加上去就是为了在Terminal中打开的时候有个图标,显得稍微好看些。
根据上面的大致方法,可以根据自己的要求来定制一些终端。比如常用的telnet、ssh和git bash等。