zohar

zohar

如何继承bash的环境变量并设置fish shell为默认shell

步骤#

  1. 创建 .bash_profile 文件,如果没有的话

  2. 在 export 环境变量后,添加如下内容

    
     eval "$(/opt/homebrew/bin/brew shellenv)"
    
    if [ -z "$INTELLIJ_ENVIRONMENT_READER" ]; then
    
     # Attempt to run fish as login shell, even if bash is technically the
     # login shell.
    
     FISH=$(env PATH="$HOME/local/bin:$HOME/local/homebrew/bin:$PATH" which fish)
    
     if [[ -x "$FISH" ]]; then
       exec env SHELL="$FISH" "$FISH" -i
     fi
    fi
    

参考#

https://github.com/ithinkihaveacat/dotfiles/blob/master/home/.bash_profile

https://www.reddit.com/r/fishshell/comments/qxo8rk/is_fish_your_default_shell_or_just_your/

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.