整合 mac terminal 在 VSCode

--

前言

在寫程式的工作上,越來越常使用 VSCode 一邊寫程式一邊下shell script 做各種操作,因此如何跟原生 terminal 有一樣的操作體驗就變成越來越重要。

正文

不做任何設定的狀況
經做調整後的狀況

目前 mac terminal 正安裝 powershell10k ,因此可以在 shell 上呈現較多的狀態資訊,但移動到 vscode 的介面就沒辦法直接帶入,因此需要調整 VSCode 上面的設定來達到體驗一致。

步驟

首先到 terminal 確認你的 zsh 安裝路徑為何,從我個人的案例則是

/usr/local/bin/zsh

第二到 VScode 裏面按下 commmand + , 打開設定視窗,並挑選到 terminal 裡面針對 terminal > integrated > Env: Osx,點下 Edit in settings.

加入這些設定

加入上面的設定,並且存檔讓這些設定生效。裡面包含 terminal 的啟動相關資訊與啟動時所使用的字體檔案。

接下來就可以到 Terminal > Integrated > Default Profile: Osx 找到 zsh 啟動之後,接下來在 VSCode 裏面新開的 terminal 就都可以用一樣的 shell 體驗了。

後話

下一個想要挑戰的就是 windows 下跟讓 VSCode terminal 跟 conda 整合。

--

--

aha (Cheng-Yu Lin)

Passionate about reading, gaming, and travel. Using AI to connect the physical & virtual worlds, I enjoy sharing ideas with others. Let's connect!