"鱼"会改变$PATH的顺序吗?如何避免这种情况


fish --version
> fish, version 3.0.2
uname -a
> Darwin Jerrys-MacBook.local 18.6.0 Darwin Kernel Version 18.6.0: Thu Apr 25 23:16:27 PDT 2019; root:xnu-4903.261.4~2/RELEASE_X86_64 x86_64
echo $TERM
> xterm-256color

我在 bash 和fishshell 中比较了我的$PATH,rvm的顺序发生了变化,这导致which pod变得不同(我用rvm来管理ruby)。

我怎样才能使它们下相同的订单?

顺便一提

  • 我已经将所有设置都包含在.bashrc中,并通过source ~/.bashrc.bash_profile加载它,并在.prfile中注明
  • 我什么都没有~/.config/fish/config.fish

x的开头字符,~=>只是我添加了标记以方便比较。

----- echo $PATH
=:~/.rvm/gems/ruby-2.2.9/bin
=:~/.rvm/gems/ruby-2.2.9@global/bin
=:~/.rvm/rubies/ruby-2.2.9/bin
X=:/opt/local/bin
X=:/opt/local/sbin
=:~/.nvm/versions/node/v8.11.3/bin
~:/usr/local/bin
~:/usr/bin
~:/bin
~:/usr/sbin
~:/sbin
>:/usr/local/share/dotnet
>:/opt/X11/bin
>:/Library/Frameworks/Mono.framework/Versions/Current/Commands
X-:~/.rvm/bin
X-:~/.local/bin
X-:/usr/local/Cellar/aria2/1.33.1/bin
X-:~/Documents/code/flutter/sdk/flutter/bin
X-:~/Documents/code/flutter/sdk/flutter/bin/cache/dart-sdk/bin
X-:~/Documents/code/flutter/sdk/flutter/.pub-cache/bin
------ fish & echo $PATH
~/usr/local/bin
~/usr/bin
~/bin
~/usr/sbin
~/sbin
>/opt/X11/bin
>/usr/local/share/dotnet
>/Library/Frameworks/Mono.framework/Versions/Current/Commands
=~/.rvm/gems/ruby-2.2.9/bin
=~/.rvm/gems/ruby-2.2.9@global/bin
=~/.rvm/rubies/ruby-2.2.9/bin
X=/opt/local/bin
X=/opt/local/sbin
=~/.nvm/versions/node/v8.11.3/bin
X-~/.rvm/bin
X-~/.local/bin
X-/usr/local/Cellar/aria2/1.33.1/bin
X-~/Documents/code/flutter/sdk/flutter/bin
X-~/Documents/code/flutter/sdk/flutter/bin/cache/dart-sdk/bin
X-~/Documents/code/flutter/sdk/flutter/.pub-cache/bin

这是此 PR 的简单解决方法,

# Download patched config
curl -O https://raw.githubusercontent.com/fish-shell/fish-shell/e18354bc6ef937e2e663fc098cc51a2546d4d2d0/share/config.fish
# Install config
mv config.fish /usr/local/share/fish/

这是我如何解决它的(仅使用fish作为zsh顶部的交互式):

.zshrc

export ZSHPATH="$PATH"
fish

.config/fish/config.fish

set PATH $ZSHPATH $PATH

简单起见,下载并安装版本fish-2.7.1.pkg该版本在Mac上没有此错误。

根据代码提交,下一个版本fish-3.1.0可能会修复此错误。

相关内容

  • 没有找到相关文章

最新更新