From c8d9fd013b5dde29a06fbff53e2223653b4e511f Mon Sep 17 00:00:00 2001 From: Yves Schumann Date: Mon, 28 Sep 2026 20:00:37 +0200 Subject: [PATCH] fix: Suppress console output during zsh initialization to avoid P10K instant prompt warnings - Add output redirection (&>/dev/null) when sourcing helper functions - Wrap export -f statements to suppress stderr during loading - This prevents P10K from detecting console output during initialization --- home-content/.bash_oc_smart.sh | 22 +++++++++++++--------- home-content/.bash_oc_smart_aliases.sh | 4 ++-- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/home-content/.bash_oc_smart.sh b/home-content/.bash_oc_smart.sh index 6d8c688..2566fc9 100644 --- a/home-content/.bash_oc_smart.sh +++ b/home-content/.bash_oc_smart.sh @@ -271,13 +271,17 @@ oc_logout() { echo -e "${GREEN}✓ Logged out${NC}" } -export -f is_oc_logged_in -export -f is_oc_token_valid -export -f get_token_expiry_info -export -f oc_smart_switch -export -f _oc_perform_login -export -f _oc_verify_project -export -f oc_status -export -f oc_contexts -export -f oc_logout +# Export functions for use in subshells (mainly for bash compatibility) +# Suppress output to avoid console noise during zsh initialization +{ + export -f is_oc_logged_in + export -f is_oc_token_valid + export -f get_token_expiry_info + export -f oc_smart_switch + export -f _oc_perform_login + export -f _oc_verify_project + export -f oc_status + export -f oc_contexts + export -f oc_logout +} 2>/dev/null diff --git a/home-content/.bash_oc_smart_aliases.sh b/home-content/.bash_oc_smart_aliases.sh index 0880bcb..b46f45e 100644 --- a/home-content/.bash_oc_smart_aliases.sh +++ b/home-content/.bash_oc_smart_aliases.sh @@ -8,8 +8,8 @@ # Source this after .bash_aliases to override the old context-only aliases # ============================================================================ -# First, source the helper functions -source ~/.bash_oc_smart.sh +# First, source the helper functions (suppress all console output during init) +source ~/.bash_oc_smart.sh &>/dev/null # ============================================================================ # AWS Shared Clusters - Smart Switch Aliases