【问题标题】:VScode terminal doesn't seem to load .bashrc or .bash_profile on windowsVScode 终端似乎没有在 Windows 上加载 .bashrc 或 .bash_profile
【发布时间】:2019-08-02 06:04:37
【问题描述】:

如果我在 VScode 中启动一个新的集成终端,它似乎不会加载我的 .bashrc 文件。一旦终端打开,我可以 source ~/.bashrc 然后出现自定义设置。我的问题似乎与此 question 重复,但是对于 windows 而不是 osx。

是否可以让 vscode 在启动集成终端的新实例时自动获取我的 .bashrc 或 .bash_profile?

到目前为止,我已经尝试了以下方法:

我已经通过设置"terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe" 将终端指向 git bash

我尝试在设置中传递一个 shell 参数,使用 "terminal.integrated.shellArgs.windows": ["-l"] 但是文档中不清楚这是否适用于 windows 或仅适用于 linux。

【问题讨论】:

  • 您能否将您的问题表述得更好一些,以便我们能更清楚地理解它?谢谢!
  • 我刚刚编辑了帖子。希望现在很清楚。谢谢!

标签: bash visual-studio-code settings git-bash vscode-settings


【解决方案1】:

将此添加到我的 settings.json 为我解决了这个问题。

"terminal.integrated.shellArgs.windows": [
    "-l"
  ]

编辑:Derp 我不擅长阅读。如果您将 .bashrc 内容移动到 .bash_profile 文件中,它可能对您有用。

【讨论】:

    猜你喜欢
    • 2019-01-20
    • 1970-01-01
    • 2019-07-01
    • 1970-01-01
    • 1970-01-01
    • 2016-03-25
    • 1970-01-01
    • 2017-07-24
    • 2014-09-21
    相关资源
    最近更新 更多