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

步骤

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

在 export 环境变量后，添加如下内容

Copy

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

参考