Try   HackMD

Visual Studio 2019 外部工具開啟Windows Terminal

tags: VisualStudio2019 WindowsTerminal Terminal

如果還不清楚Windows Terminal參考下圖,可從Microsoft Store下載。

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

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

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

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

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

這邊設定填入

Windows Terminal位置可以先找一下,可能因版本差異有所不同。

  • 標題Terminal
  • 命令:C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.3.2651.0_x64__8wekyb3d8bbwe\wt.exe
  • 引數:-d $(ProjectDir).

引數部分要注意! 根據微軟官方文件可以給-d引數設定開啟時的目錄位置,但是在Visual Studio內設定時最後需要加上.開啟時才不會發生錯誤。

第二種作法是先開啟cmd,再用cmd開啟Windows Terminal

  • 標題Terminal2
  • 命令:cmd.exe
  • 引數:/c start wt -d $(ProjectDir)

第二種參考此篇設定,但此種方式有個缺點,就是會先閃一個黑cmd視窗才開啟。

設定完成後就會在工具下拉選單顯示剛才的TerminalTerminal2

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →