You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

VSCode远程终端忽略terminal.integrated.profiles.linux配置,无法加载.bashrc

远程VSCode终端无法加载.bashrc的问题
  • 远程机器存在.bashrc文件,通过VSCode远程开发扩展登录后,终端未加载该文件
  • 最初误以为是登录shell的加载逻辑问题,修改相关文件后无效果
  • 查看终端启动命令为:
    /bin/bash '--init-file' '/root/.vscode-server/bin/ddc367ed5c8936efe395cffeec279b04ffd7db78/out/vs/workbench/contrib/terminal/common/scripts/shellIntegration-bash.sh'
    
  • 在>Preferences: Open Remote Settings中禁用Terminal > Integrated > Shell integration: Enabled选项后,终端启动命令变为:
    /bin/bash
    
  • 尝试修改settings.json配置:
    原配置:
    "terminal.integrated.profiles.linux": {
        "bash": {
            "path": "bash",
            "icon": "terminal-bash",
        },
    
    修改为添加args参数(期望让bash以登录shell模式运行从而加载.bashrc):
    "terminal.integrated.profiles.linux": {
        "bash": {
            "path": "bash",
            "icon": "terminal-bash",
            "args": [ "l" ]
        },
    
  • 问题仍未解决:远程终端似乎忽略settings.json中的通用配置,尝试过相关解决方案也无效果

内容的提问来源于stack exchange,提问作者Jacopo

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.13 19:37:08