diff options
author | Guangxiong Lin <[email protected]> | 2023-11-16 00:14:24 +0800 |
---|---|---|
committer | Guangxiong Lin <[email protected]> | 2023-11-16 00:14:24 +0800 |
commit | 8a70b6e6836c7394f511725a79bf7ac07bfb36c0 (patch) | |
tree | 7f3f0828a4df81a9d72890192886c735f8e40272 | |
parent | 038d7f14f55bc1c91d0d9d64ae5acecd5b5acc45 (diff) | |
download | dotfiles-8a70b6e6836c7394f511725a79bf7ac07bfb36c0.tar.gz dotfiles-8a70b6e6836c7394f511725a79bf7ac07bfb36c0.tar.bz2 dotfiles-8a70b6e6836c7394f511725a79bf7ac07bfb36c0.zip |
Track fish manually
-rw-r--r-- | .bashrc | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -2,6 +2,7 @@ # ~/.bashrc # +[ "$(uname)" = Darwin ] && source "$HOME/.macos" source "$HOME/.env" source "$HOME/.path" @@ -13,12 +14,13 @@ PS1='[\u@\h \W]\$ ' source "$HOME/.aliases" source "$HOME/.fzfrc" + if command -v fish > /dev/null; then - if [[ ( $(uname) == Darwin || # the ps command is not invalid in bsd - "$(ps --no-header --pid=$PPID --format=comm)" != "fish") && \ - -z ${BASH_EXECUTION_STRING} ]] + __FISH_IS_ACTIVE=${__FISH_IS_ACTIVE:-0} + if [[ -z ${BASH_EXECUTION_STRING} && $__FISH_IS_ACTIVE -eq 0 ]] then shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION='' - exec fish $LOGIN_OPTION + exec env __FISH_IS_ACTIVE=1 fish $LOGIN_OPTION fi + export __FISH_IS_ACTIVE=0 fi |