答案1
看來您的編輯器配置了錯誤的路徑(或其相關終端插件),無論如何,我也會建議檢查/更新您的預設 shell 提供者。
若要檢查/更新您的 shell 提供者配置,您可以使用sudo update-alternatives --config sh
列出和變更已安裝的 shell 解釋器之間的預設值(ash/dash、zsh、fish、bash...)。
也可以直接設定為巴什使用sudo update-alternatives --install /bin/sh sh /bin/bash 100
。
然後您應該檢查編輯器的配置以及用於啟動/打開終端的插件(原子末端、末端加等)。
- 你應該
/bin/bash
在哪裡使用外殼解釋器路徑為必填項。 - 使用
/usr/bin/gnome-terminal
or/usr/bin/x-terminal-emulator
where 的路徑終端模擬器應用程式是必須的。
希望能幫助你。
答案2
我最近遇到了同樣的問題。我建議您的最簡單的解決方案是在 Visual Studio Code 的 settings.json 檔案中新增此行。最新版本的 Code 可讓您透過 GUI 編輯 settings.json。將其切換到 JSON 視圖模式。您可以在右上角找到該切換按鈕。
"terminal.integrated.shell.linux": "bash"
而且,你已經完成了。運行終端。 Bash 應該會增強。
答案3
- 開啟首選項 > 設定或直接使用
Ctrl+,
- 搜尋
Terminal › Integrated › Shell: Linux
- 點選
Edit in settings.json
- 最後添加此行
"terminal.integrated.shell.linux" : "/bin/bash"
並重新啟動您的應用程式。