diff --git a/launcher.sh b/launcher.sh index 0d0e002..fb79b1e 100755 --- a/launcher.sh +++ b/launcher.sh @@ -1507,19 +1507,12 @@ main() { read -p "Clean history and remove traces? (yes/no): " clean_hist if [ "$clean_hist" = "yes" ]; then - # Run the trace eraser in auto mode (removes files, logs, directory) - TRACE_ERASER_AUTO=yes bash "$BASE_DIR/tools/erase-toolkit-traces.sh" 2>&1 | grep -E "^✓|^$" || true - - # Create a simple helper script for parent shell history cleanup - # (Parent shell needs to source this since subprocess can't modify parent's history) - cat > /tmp/.cleanup_hist.sh << 'HIST_EOF' -set +o history; shopt -u histappend 2>/dev/null; GREP_PATTERN="git\.mull\.lol|linux-server-management-toolkit|server-toolkit|launcher\.sh|erase-toolkit-traces"; [ -f ~/.bash_history ] && cp ~/.bash_history ~/.bash_history.bak.$$ && grep -Ev "$GREP_PATTERN" ~/.bash_history.bak.$$ > ~/.bash_history 2>/dev/null && rm -f ~/.bash_history.bak.$$; history -c; history -r ~/.bash_history; unset HISTFILE; rm -f /tmp/.cleanup_hist.sh; echo ""; echo "✓ History cleaned"; echo "" -HIST_EOF - echo "" - echo -e "${GREEN}✓ All traces removed${NC}" + echo -e "${YELLOW}After launcher exits, run:${NC}" echo "" - echo -e "${YELLOW}Run this to finish cleanup:${NC} source /tmp/.cleanup_hist.sh" + echo "TRACE_ERASER_AUTO=yes source $BASE_DIR/tools/erase-toolkit-traces.sh" + echo "" + echo -e "${YELLOW}This will clean history in your current shell and remove all traces.${NC}" echo "" else echo ""