Terminal我只推薦Windows Terminal
===
###### tags: `WSL` `Linux` `Ubuntu` `Terminal`

Terminal 的軟體很多,我用過[Cmder](https://cmder.net/),[Fluent Terminal](https://www.microsoft.com/zh-tw/p/fluent-terminal/9p2krlmfxf9t?activetab=pivot:overviewtab),
但後來還是覺得在支援WSL這塊,還是Windows原生的軟件比較穩定。
安裝
---
直接去Windows store搜尋Windows Terminal 就可以找到了呦
設定
---
點開設定可以看到你所安裝的WSL都會自動連結起來了

這邊主要看一下設定的地方
```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": "{6f9994f0-4403-5e85-9cce-98e5da3839bb}",
"profiles":
{
"defaults":
{
// Put settings here that you want to apply to all profiles
},
"list":
[
{
"guid": "{6f9994f0-4403-5e85-9cce-98e5da3839bb}",
"hidden": false,
"name": "Ubuntu-16.04",
"source": "Windows.Terminal.Wsl",
"commandline": "wsl.exe ~",
"fontFace": "SauceCodePro Nerd Font",
// "colorScheme": "Solarized Dark - Patched",
// "colorScheme": "Builtin Solarized Light",
"colorScheme": "Zenburn",
"fontSize": 14,
},
{
"guid": "{c6eaf9f4-32a7-5fdc-b5cf-066e8a4b1e40}",
"hidden": false,
"name": "Ubuntu-18.04",
"source": "Windows.Terminal.Wsl",
// "startingDirectory": "\\\\wsl$\\Ubuntu-18.04\\home\\stephen",
"colorScheme": "Zenburn",
"fontFace": "SauceCodePro Nerd Font",
"fontSize": 14,
},
{
"guid": "{07b52e3e-de2c-5db4-bd2d-ba144ed6c273}",
"hidden": false,
"name": "Ubuntu-20.04",
"source": "Windows.Terminal.Wsl",
"startingDirectory": "\\\\wsl$\\Ubuntu-20.04\\home\\stephen",
"colorScheme": "Solarized Dark - Patched",
"fontFace": "SauceCodePro Nerd Font",
"fontSize": 14,
},
{
// Make changes here to the powershell.exe profile
"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"name": "Windows PowerShell",
"commandline": "powershell.exe",
"hidden": false
},
{
// Make changes here to the cmd.exe profile
"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"
}
]
},
// Add custom color schemes to this array
"schemes":
[
{
"name": "Solarized Dark - Patched",
"black": "#002831",
"red": "#d11c24",
"green": "#738a05",
"yellow": "#a57706",
"blue": "#2176c7",
"purple": "#c61c6f",
"cyan": "#259286",
"white": "#eae3cb",
"brightBlack": "#475b62",
"brightRed": "#bd3613",
"brightGreen": "#475b62",
"brightYellow": "#536870",
"brightBlue": "#708284",
"brightPurple": "#5956ba",
"brightCyan": "#819090",
"brightWhite": "#fcf4dc",
"background": "#001e27",
"foreground": "#708284"
},
{
"name": "Builtin Solarized Light",
"black": "#073642",
"red": "#dc322f",
"green": "#859900",
"yellow": "#b58900",
"blue": "#268bd2",
"purple": "#d33682",
"cyan": "#2aa198",
"white": "#eee8d5",
"brightBlack": "#002b36",
"brightRed": "#cb4b16",
"brightGreen": "#586e75",
"brightYellow": "#657b83",
"brightBlue": "#839496",
"brightPurple": "#6c71c4",
"brightCyan": "#93a1a1",
"brightWhite": "#fdf6e3",
"background": "#fdf6e3",
"foreground": "#657b83"
},
{
"name": "Zenburn",
"black": "#4d4d4d",
"red": "#705050",
"green": "#60b48a",
"yellow": "#f0dfaf",
"blue": "#506070",
"purple": "#dc8cc3",
"cyan": "#8cd0d3",
"white": "#dcdccc",
"brightBlack": "#709080",
"brightRed": "#dca3a3",
"brightGreen": "#c3bf9f",
"brightYellow": "#e0cf9f",
"brightBlue": "#94bff3",
"brightPurple": "#ec93d3",
"brightCyan": "#93e0e3",
"brightWhite": "#ffffff",
"background": "#3f3f3f",
"foreground": "#dcdccc"
}
],
// Add any keybinding overrides to this array.
// To unbind a default keybinding, set the command to "unbound"
"keybindings": []
}
```
預設開啟
---
來看看第8行的
```json=
"defaultProfile": "{6f9994f0-4403-5e85-9cce-98e5da3839bb}",
```
如果你第一次打開,應該都會預設PowerShell
這邊可以把後面這一串改成你要的預設程式
也就是後面list的部分,這些就是你的程式
只要把guid後面的那串數字拉到defaultProfile就可以了
像我現在就是預設開啟Ubuntu-16.04
預設路徑
---
再來你開啟的時候,路徑一定指向超奇怪的地方
在每個程式的描述裡面加上==startingDirectory==後免加上你要指向的路徑即可
```json=
"startingDirectory": "\\\\wsl$\\Ubuntu-20.04\\home\\stephen",
```
標題名稱
---
若引用預設路徑後,標題會被蓋掉

加入以下設定,可以改回自己想要的標題名稱
```json=
"suppressApplicationTitle":true,
"tabTitle" : "Ubuntu-16.04 WSL2"
```

主題風格
---
看看74~140行
這邊指的是主題風格的配色
一樣若要在哪個程式裡面採用哪一種配色
就在List裡面找到對應的程式(啥?怎麼找,看name阿)
然後加上==colorScheme==
像底下這樣去對應到你的主題風格的名稱即可
```json=
"colorScheme": "Zenburn",
```
:::info
更多的主題設定可以到這邊來看看 :arrow_right: [iTerm2-Color-Schemes](https://github.com/mbadolato/iTerm2-Color-Schemes)
:::
字型
---
在fontFace後面加上字型名稱就可以了
記得要用powerline font
```json=
"fontFace": "SauceCodePro Nerd Font",
```
:::info
更多的powerline font可以到這邊來看看 :arrow_right: [powerline font](https://github.com/powerline/fonts)
:::
美觀這種事情不能妥協阿,你一天要看他8小時以上,
一定不能看到畫面就不爽阿!
==[colorScheme]-Zenburn==

毛玻璃效果
---
```json=
"useAcrylic": true,
"acrylicOpacity": 0.5,//透明度
```

背景桌面
---
```json=
"useAcrylic": false, //若使用背景則須關閉毛玻璃效果
"backgroundImage": "ms-appdata:///roaming/wsl/n9xDZcs.jpeg",
"backgroundImageOpacity": 0.75,
```

好惹,現在開起來的WSL配色看起來舒爽多了。