windows terminal添加自定義的終端工具或命令


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等。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM