# Visual Studio 2019 外部工具開啟Windows Terminal
###### tags: `VisualStudio2019` `WindowsTerminal` `Terminal`
如果還不清楚Windows Terminal參考下圖,可從Microsoft Store下載。

此篇記錄一下如何在Visual Studio 2019內設定外部工具開啟Windows Terminal,設定為上方選單**工具->外部工具**

點選開啟後會跳出以下視窗

這邊設定填入
:::info
Windows Terminal位置可以先找一下,可能因版本差異有所不同。
:::
- 標題`Terminal`
- 命令:`
C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.3.2651.0_x64__8wekyb3d8bbwe\wt.exe
`
- 引數:`-d $(ProjectDir).`
:::warning
引數部分要注意! 根據[微軟官方文件](https://docs.microsoft.com/zh-tw/windows/terminal/command-line-arguments?tabs=windows)可以給`-d`引數設定開啟時的目錄位置,但是在Visual Studio內設定時最後需要加上`.`開啟時才不會發生錯誤。
:::
第二種作法是先開啟cmd,再用cmd開啟Windows Terminal
- 標題`Terminal2`
- 命令:`cmd.exe`
- 引數:`/c start wt -d $(ProjectDir)`
第二種參考[此篇](https://weblog.west-wind.com/posts/2015/jan/09/tip-create-a-visual-studio-menu-option-to-open-a-command-window)設定,但此種方式有個缺點,就是會先閃一個黑cmd視窗才開啟。
設定完成後就會在工具下拉選單顯示剛才的**Terminal**與**Terminal2**
