File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1198,7 +1198,12 @@ run_interactive() {
11981198
11991199 echo " "
12001200 if (( rc == 0 )) ; then
1201- printf " %s%s✓ Done (exit %d)%s\n" " $DIM " " $GREEN " " $rc " " $RESET "
1201+ printf " %s✓ Done (exit %d)%s\n" " $GREEN " " $rc " " $RESET "
1202+ # Warn about commands that modify the shell environment
1203+ if [[ " $cmd " =~ (^| [;& | ]\ * )(source| \. )\ ]] || [[ " $cmd " =~ activate ]]; then
1204+ printf " %s Tip: environment changes (eg. venv activation) don't persist outside hdi.%s\n" " $DIM " " $RESET "
1205+ printf " %s You may prefer to run this command directly in your shell instead.%s\n\n" " $DIM " " $RESET "
1206+ fi
12021207 else
12031208 printf " %s%s✗ Exited with code %d%s\n" " $BOLD " " $YELLOW " " $rc " " $RESET "
12041209 fi
Original file line number Diff line number Diff line change @@ -411,7 +411,12 @@ run_interactive() {
411411
412412 echo " "
413413 if (( rc == 0 )) ; then
414- printf " %s%s✓ Done (exit %d)%s\n" " $DIM " " $GREEN " " $rc " " $RESET "
414+ printf " %s✓ Done (exit %d)%s\n" " $GREEN " " $rc " " $RESET "
415+ # Warn about commands that modify the shell environment
416+ if [[ " $cmd " =~ (^| [;& | ]\ * )(source| \. )\ ]] || [[ " $cmd " =~ activate ]]; then
417+ printf " %s Tip: environment changes (eg. venv activation) don't persist outside hdi.%s\n" " $DIM " " $RESET "
418+ printf " %s You may prefer to run this command directly in your shell instead.%s\n\n" " $DIM " " $RESET "
419+ fi
415420 else
416421 printf " %s%s✗ Exited with code %d%s\n" " $BOLD " " $YELLOW " " $rc " " $RESET "
417422 fi
You can’t perform that action at this time.
0 commit comments