調整 Visual Studio 的 Terminal 也擁有高又帥執行環境

調整 Visual Studio 的 Terminal 也擁有高又帥執行環境

蠻喜歡在 Visual Studio Code 去使用 Terminal 裡感覺。Visual Studio Code 的 Terminal 通常在 Windows Terminal 裡去設定好 pwsh 的環境後,除了要記得改 Nerd Fonts 字型設定外,Visual Studio Code 就自動把 pwsh 環境吃過去使用了。但在 Visual Studio 還需要動一些設定才能把 Terminal 改的跟 Visual Studio Code 一樣順手,筆記一下需要調整的部分。

一、Visual Studio 預設啟用【開發人員 PowerShell】,讓我們修改使用【PowerShell 7】,在【Environment】→【Terminal】將【PowerShell 7】設定為【Default】:

set pwsh default

二、快速鍵

在【Keyboard】搜尋【terminal】可以找到【View.Terminal】,確定一下快速鍵是不是【Ctrl+`】。你可以選你喜歡的組合,但如果你會在多個 Editor 使用 Terminal,那麼一致組態會是比較好的建議。

vs terminal shortcut

三、Nerd Fonts 字型

vs terminal incorrect font

如果你已經修改文字字型並確定採用 Nerd Fonts 的字型會發現沒有作用,會有圖示變成?的問題。那是因為 Visual Studio 把 Terminal 字型另外獨立出來設定。

vs Options font text editor

在下拉選單選擇【Terminal】並修改使用 Nerd Fonts 字型:

vs Options font terminal

修改套用後立即生效:

vs terminal pwsh

這樣在 Visual Studio 就擁有一個和 Visual Studio Code 連快速鍵都一樣且美美的 Terminal 環境了。

  • 在 Terminal 找之前打過的 git commit 來參考或修改,是我最愛的功能之一。在 UI 上每次都要重打,重找 #Id,實在太浪費時間了。 😑
  • UI 也不是沒有好處,UI 有 Copilot 可以幫忙寫 commit,我再貼過來 Terminal 裡。 😻
  • 目前 Visual Studio 的 Terminal 我覺得已經有 95 分了,差的那 5 分我有提一份建議,如果你覺得不錯,可以幫忙 Vote 一下。

沒有留言:

張貼留言

感謝您的留言,如果我的文章你喜歡或對你有幫助,按個「讚」或「分享」它,我會很高興的。