是 Ray 不是 Array

整理這些技術筆記真的很花時間,如果你願意 關閉 Adblock 支持我,我會把這份感謝轉換成更多「踩坑轉避坑」的內容給你!ヽ(・∀・)ノ

Advertisement
2021-09-27 VSCode

VSCode terminal.integrated.shell.osx 屬性失效

前言

最近 VSCode 發現終端機的 terminal.integrated.shell.osx 設置失效了,所以記錄一下問題跟解決方式。

事發原因

因為 VSCode 更新速度其實滿快的,在開發上我們都會有一些個人化的開發環境設定,剛好有一條設定檔案中的「"terminal.integrated.shell.osx": "/bin/zsh"」屬性建議調整,所以就記錄一下如何調整。

解決方式

基本上依據 VSCode 提示就可以知道如何調整:

這已被取代,設定預設殼層的新建議方式是在 #terminal.integrated.profiles.osx# 中建立終端設定檔,並將其設定檔名稱設為 #terminal.integrated.defaultProfile.osx# 中的預設值。這將會優先使用新的設定檔設定,但將來會變更。(2)

這已被取代

因此這邊只需要將 "terminal.integrated.shell.osx": "/bin/zsh" 替換成 "terminal.integrated.defaultProfile.osx": "zsh" 就可以囉。

另一個屬性則是 terminal.integrated.profiles.osx 我覺得這個屬性滿好玩的,你還可以針對該終端機給予 icon 樣式,例如給星星:

1
2
3
4
5
6
"terminal.integrated.profiles.osx": {
"bash": {
"path": "/bin/zsh",
"icon": "star",
}
},

原始樣式:
原始 icon

調整後的樣式:

Star

而 icon 的樣式你可以在下拉選單找到,由於太多我就不列出了:

icon

而這個 terminal.integrated.profiles.osx 屬性之所以特別是因為它還可以設定多組終端資訊與樣式:

1
2
3
4
5
6
7
8
9
10
"terminal.integrated.profiles.osx": {
"bash2": {
"path": "/bin/bash",
"icon": "star",
},
"zsh": {
"path": "/bin/zsh",
"icon": "star",
}
},

bash2

請注意,以上是 Mac OS 系統,如果是 Windows 則是以下:

1
2
3
4
5
6
7
"terminal.integrated.profiles.windows": {
"PowerShell -NoProfile": {
"source": "PowerShell",
"args": ["-NoProfile"]
}
},
"terminal.integrated.defaultProfile.windows": "my-pwsh"

linux 則是:

1
2
3
4
5
6
7
8
"terminal.integrated.profiles.linux": {
"zsh (login)": {
"path": "zsh",
"args": ["-l"]
}
}

"terminal.integrated.defaultProfile.linux": "zsh",

參考文獻

整理這些技術筆記真的很花時間,如果你願意 關閉 Adblock 支持我,我會把這份感謝轉換成更多「踩坑轉避坑」的內容給你!ヽ(・∀・)ノ

Advertisement

你的支持會直接轉換成更多技術筆記

如果我的筆記讓你少踩一個坑、節省 Debug 的時間,
也許你可以請我喝杯咖啡,讓我繼續當個不是 Array 的 Ray ☕

buymeacoffee | line | portaly

Terminal

分享這篇文章

留言

© 2025 Ray. All rights reserved.

Powered by Ray Theme