@@ -15,9 +15,10 @@ export function shellcode(_testMode: boolean = false): string {
15
15
16
16
// Use config-backed shell message configuration with {path} substitution
17
17
const showMessages = config . showShellMessages ? 'true' : 'false'
18
- // Replace {path} with shell-evaluated basename
18
+ // Replace {path} with shell-evaluated basename (italic)
19
19
const activationMessage = ( config . shellActivationMessage || '✅ Environment activated for {path}' )
20
- . replace ( '{path}' , '$(basename "$project_dir")' )
20
+ . replace ( '{path}' , '\\x1B[3m$(basename "$project_dir")\\x1B[0m' )
21
+ . replace ( / \n $ / , '' )
21
22
const deactivationMessage = config . shellDeactivationMessage || 'Environment deactivated'
22
23
23
24
// Verbosity: default to verbose for shell integration unless explicitly disabled
@@ -263,18 +264,15 @@ __launchpad_switch_environment() {
263
264
# If no project found, check if we need to deactivate current project
264
265
if [[ -z "$project_dir" ]]; then
265
266
# If we were in a project but now we're not, deactivate it
266
- if [[ -n "$LAUNCHPAD_CURRENT_PROJECT" && -n "$LAUNCHPAD_ENV_BIN_PATH" ]]; then
267
- # Remove project-specific paths from PATH
268
- export PATH=$(echo "$PATH" | sed "s|$LAUNCHPAD_ENV_BIN_PATH:||g" | sed "s|:$LAUNCHPAD_ENV_BIN_PATH||g" | sed "s|^$LAUNCHPAD_ENV_BIN_PATH$||g")
269
-
270
- # Show deactivation message if enabled (only once per deactivation)
271
- if [[ "${ showMessages } " == "true" && -n "$__LAUNCHPAD_LAST_ACTIVATION_KEY" ]]; then
272
- printf "${ deactivationMessage } \\n" >&2
267
+ if [[ -n "$__LAUNCHPAD_LAST_ACTIVATION_KEY" ]]; then
268
+ # Remove project-specific paths from PATH if they exist
269
+ if [[ -n "$LAUNCHPAD_ENV_BIN_PATH" ]]; then
270
+ export PATH=$(echo "$PATH" | sed "s|$LAUNCHPAD_ENV_BIN_PATH:||g" | sed "s|:$LAUNCHPAD_ENV_BIN_PATH||g" | sed "s|^$LAUNCHPAD_ENV_BIN_PATH$||g")
273
271
fi
274
272
275
- # Verbose: deactivated environment
276
- if [[ "$verbose_mode " == "true" && "$__lp_should_verbose_print" == "1 " ]]; then
277
- printf "⚪ Deactivated environment \n" >&2
273
+ # Show deactivation message if enabled
274
+ if [[ "${ showMessages } " == "true" ]]; then
275
+ printf "${ deactivationMessage } \ \n" >&2
278
276
fi
279
277
280
278
unset LAUNCHPAD_CURRENT_PROJECT
@@ -325,22 +323,20 @@ __launchpad_switch_environment() {
325
323
fi
326
324
fi
327
325
326
+ # Show activation message if enabled (when project changes)
327
+ if [[ "${ showMessages } " == "true" ]]; then
328
+ if [[ "$__LAUNCHPAD_LAST_ACTIVATION_KEY" != "$project_dir" ]]; then
329
+ printf "${ activationMessage } \n" >&2
330
+ fi
331
+ fi
332
+ export __LAUNCHPAD_LAST_ACTIVATION_KEY="$project_dir"
333
+
328
334
# If environment exists, activate it
329
335
if [[ -d "$env_dir/bin" ]]; then
330
336
export LAUNCHPAD_CURRENT_PROJECT="$project_dir"
331
- export LAUNCHPAD_ENV_BIN_PATH="$env_dir/bin"
337
+ export LAUNCHPAD_ENV_BIN_PATH="$env_dir/bin"
332
338
export PATH="$env_dir/bin:$PATH"
333
-
334
- # Show activation message if enabled (only when env changes)
335
- if [[ "${ showMessages } " == "true" ]]; then
336
- if [[ "$__LAUNCHPAD_LAST_ACTIVATION_KEY" != "$env_dir" ]]; then
337
- printf "${ activationMessage } " >&2
338
- fi
339
- fi
340
- export __LAUNCHPAD_LAST_ACTIVATION_KEY="$env_dir"
341
-
342
339
# Removed verbose activated environment path message
343
-
344
340
# Ensure dynamic linker can find Launchpad-managed libraries (macOS/Linux)
345
341
# Build a list of library directories from the active environment and global install
346
342
__lp_add_unique_colon_path() {
@@ -391,8 +387,8 @@ __launchpad_switch_environment() {
391
387
fi
392
388
done
393
389
else
394
- # Environment not ready - skip setup during shell integration to prevent hanging
395
- # User can run 'launchpad install <project>' manually when needed
390
+ # Environment not ready - user can run 'launchpad install <project>' manually when needed
391
+ :
396
392
fi
397
393
fi
398
394
0 commit comments