@@ -864,12 +864,13 @@ __launchpad_chpwd() {
864
864
__launchpad_ensure_system_path
865
865
__launchpad_ensure_env_path_priority
866
866
867
- # Mark as ready for future use and do maintenance in background
868
- {
867
+ # Mark as ready for future use and do maintenance in background (completely detached)
868
+ (
869
869
touch "$env_dir/.launchpad_ready" 2>/dev/null || true
870
870
mkdir -p "$(dirname "$cache_file")" 2>/dev/null || true
871
871
touch "$cache_file" 2>/dev/null || true
872
- } >/dev/null 2>&1 &
872
+ ) >/dev/null 2>&1 &
873
+ disown 2>/dev/null || true
873
874
874
875
if [[ "\${LAUNCHPAD_SHOW_ENV_MESSAGES:-${ showMessages } }" != "false" ]]; then
875
876
printf "${ activationMessage } \n" >&2
@@ -931,7 +932,7 @@ __launchpad_chpwd() {
931
932
__launchpad_ensure_env_path_priority
932
933
933
934
# All file operations in background
934
- {
935
+ (
935
936
mkdir -p "$(dirname "$cache_file")" 2>/dev/null || true
936
937
touch "$cache_file" 2>/dev/null || true
937
938
if [[ -z "$dep_file" ]]; then
@@ -945,7 +946,8 @@ __launchpad_chpwd() {
945
946
if [[ -n "$fp_current" ]]; then
946
947
echo "$fp_current" > "$env_dir/.deps_fingerprint" 2>/dev/null || true
947
948
fi
948
- } &
949
+ ) >/dev/null 2>&1 &
950
+ disown 2>/dev/null || true
949
951
950
952
# Verbose diagnostics for fast path activation
951
953
if [[ "$LAUNCHPAD_VERBOSE" == "true" ]]; then
@@ -1062,7 +1064,8 @@ export LAUNCHPAD_PROJECT_DIR=\"$project_dir\"
1062
1064
fi
1063
1065
1064
1066
# Defer post-setup quietly without background job output; precmd hook will refresh (async)
1065
- { touch "$HOME/.cache/launchpad/shell_cache/global_refresh_needed" 2>/dev/null || true; } &
1067
+ (touch "$HOME/.cache/launchpad/shell_cache/global_refresh_needed" 2>/dev/null || true) >/dev/null 2>&1 &
1068
+ disown 2>/dev/null || true
1066
1069
1067
1070
# Ensure global dependencies are still in PATH after project setup
1068
1071
__launchpad_ensure_global_path
@@ -1071,12 +1074,13 @@ export LAUNCHPAD_PROJECT_DIR=\"$project_dir\"
1071
1074
__launchpad_ensure_env_path_priority
1072
1075
1073
1076
# Mark environment ready for instant future activation (both cache and marker) - async
1074
- {
1077
+ (
1075
1078
mkdir -p "$env_dir" 2>/dev/null || true
1076
1079
touch "$env_dir/.launchpad_ready" 2>/dev/null || true
1077
1080
mkdir -p "$(dirname "$cache_file")" 2>/dev/null || true
1078
1081
touch "$cache_file" 2>/dev/null || true
1079
- } &
1082
+ ) >/dev/null 2>&1 &
1083
+ disown 2>/dev/null || true
1080
1084
1081
1085
# Show clean activation message
1082
1086
if [[ "\${LAUNCHPAD_SHOW_ENV_MESSAGES:-${ showMessages } }" != "false" ]]; then
@@ -1111,10 +1115,12 @@ export LAUNCHPAD_PROJECT_DIR=\"$project_dir\"
1111
1115
export PATH="$LAUNCHPAD_ORIGINAL_PATH"
1112
1116
1113
1117
# Re-add global dependencies to PATH even when deactivating (async)
1114
- { __launchpad_ensure_global_path; } >/dev/null 2>&1 &
1118
+ (__launchpad_ensure_global_path) >/dev/null 2>&1 &
1119
+ disown 2>/dev/null || true
1115
1120
1116
1121
# Clear command hash table after PATH restoration (async)
1117
- { hash -r 2>/dev/null || true; } &
1122
+ (hash -r 2>/dev/null || true) >/dev/null 2>&1 &
1123
+ disown 2>/dev/null || true
1118
1124
fi
1119
1125
1120
1126
# Restore original library paths
0 commit comments