@@ -321,7 +321,7 @@ __launchpad_switch_environment() {
321
321
# Non-blocking on-demand install with retry backoff (no artificial timeout)
322
322
local cache_dir="$HOME/.cache/launchpad/shell_cache"
323
323
mkdir -p "$cache_dir" 2>/dev/null || true
324
- local backoff_marker="$cache_dir/install_backoff_$(echo "$env_dir" | sed 's/\//_/g ')"
324
+ local backoff_marker="$cache_dir/install_backoff_$(echo "$env_dir" | tr '/' '_ ')"
325
325
326
326
local now_s=$(date +%s 2>/dev/null || echo 0)
327
327
local retry_after=600 # 10 minutes
@@ -334,8 +334,11 @@ __launchpad_switch_environment() {
334
334
fi
335
335
336
336
if [[ "$should_attempt" -eq 1 ]]; then
337
- : > "$backoff_marker" 2>/dev/null || true
338
- if LAUNCHPAD_DISABLE_SHELL_INTEGRATION=1 LAUNCHPAD_SHELL_INTEGRATION=1 ${ launchpadBinary } install "$project_dir"; then
337
+ # Suppress installer output in hooks to avoid stray blank lines in the prompt
338
+ if LAUNCHPAD_DISABLE_SHELL_INTEGRATION=1 LAUNCHPAD_SHELL_INTEGRATION=1 ${ launchpadBinary } install "$project_dir" >/dev/null 2>&1; then
339
+ if [[ "$verbose_mode" == "true" && "$__lp_should_verbose_print" == "1" ]]; then
340
+ printf "📦 Installed project dependencies (on-demand)\n" >&2
341
+ fi
339
342
if [[ -d "$env_dir/bin" ]]; then
340
343
export LAUNCHPAD_CURRENT_PROJECT="$project_dir"
341
344
export LAUNCHPAD_ENV_BIN_PATH="$env_dir/bin"
@@ -346,8 +349,12 @@ __launchpad_switch_environment() {
346
349
if [[ "$verbose_mode" == "true" && "$__lp_should_verbose_print" == "1" ]]; then
347
350
printf "✅ Activated environment after install: %s\n" "$env_dir" >&2
348
351
fi
352
+ # Clear any backoff marker after successful install
353
+ rm -f "$backoff_marker" 2>/dev/null || true
349
354
fi
350
355
else
356
+ # Touch backoff marker only on failure to avoid repeated attempts
357
+ : > "$backoff_marker" 2>/dev/null || true
351
358
if [[ "$verbose_mode" == "true" && "$__lp_should_verbose_print" == "1" ]]; then
352
359
printf "⏭️ Deferred on-demand install. Run 'launchpad install %q' manually.\n" "$project_dir" >&2
353
360
fi
0 commit comments