diff --git a/tools/erase-toolkit-traces.sh b/tools/erase-toolkit-traces.sh index 3bd6fc4..ee4a2ad 100755 --- a/tools/erase-toolkit-traces.sh +++ b/tools/erase-toolkit-traces.sh @@ -145,6 +145,9 @@ if [ "$CLEAN_HISTORY" = true ] && [ -f ~/.bash_history ]; then echo "" echo "→ Final cleanup: Removing bash history..." + # Disable history recording for this session to prevent re-adding commands + set +o history + # Remove last 10 lines from history file (covers toolkit download/usage) total_lines=$(wc -l < ~/.bash_history) if [ "$total_lines" -gt 10 ]; then @@ -157,12 +160,16 @@ if [ "$CLEAN_HISTORY" = true ] && [ -f ~/.bash_history ]; then echo " ✓ Cleared entire history (had < 10 entries)" fi - # Clear in-memory history and write clean file + # Clear in-memory history completely history -c + + # Write the empty history to file history -w echo "" echo " ✓ Bash history cleaned" + echo "" + echo "NOTE: Run 'exec bash' or logout/login to start fresh shell with clean history." fi echo ""