From 217ad22b782a5c6835332c1dc17d733ecc5f971f Mon Sep 17 00:00:00 2001 From: Uyanide Date: Sun, 15 Mar 2026 09:30:48 +0100 Subject: [PATCH] refactor fish auto-login logic in .bashrc --- config/shell/.bashrc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/config/shell/.bashrc b/config/shell/.bashrc index da07308..17b583d 100644 --- a/config/shell/.bashrc +++ b/config/shell/.bashrc @@ -140,10 +140,11 @@ if [[ ${UY_USING_SSH_AGENT:-0} == 1 ]]; then fi # Auto-login to fish if UY_ENABLE_FISH_AUTO_LOGIN=1 is set in .profile -if type fish &>/dev/null && [[ ${UY_ENABLE_FISH_AUTO_LOGIN:-0} == 1 ]]; then +if type fish &>/dev/null; then alias f="exec fish" - if [[ $(ps --no-header --pid=$PPID --format=comm) != "fish" && -z ${BASH_EXECUTION_STRING} && ${SHLVL} == 1 ]]; then + if [[ ${UY_ENABLE_FISH_AUTO_LOGIN:-0} == 1 ]] && + [[ $(ps --no-header --pid=$PPID --format=comm) != "fish" && -z ${BASH_EXECUTION_STRING} && ${SHLVL} == 1 ]]; then shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION='' exec fish $LOGIN_OPTION fi