From 612fd84d3e90b5ad4683c99986291d65f342cac7 Mon Sep 17 00:00:00 2001 From: cschantz Date: Mon, 10 Nov 2025 23:18:16 -0500 Subject: [PATCH] Add history command removal to trace eraser MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changes: - Remove all 'history' command entries after toolkit cleanup - Prevents showing investigation/debugging commands - Uses same history -d approach for consistency Removes: - history - history | grep curl - cat .bash_history - Any other history command variants Tested: ✓ Removed 3 history command entries from test ✓ Only clean commands remain in history --- tools/erase-toolkit-traces.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tools/erase-toolkit-traces.sh b/tools/erase-toolkit-traces.sh index cdaf543..0d29cd2 100755 --- a/tools/erase-toolkit-traces.sh +++ b/tools/erase-toolkit-traces.sh @@ -163,6 +163,19 @@ if [ "$CLEAN_HISTORY" = true ] && [ -f ~/.bash_history ]; then echo " ✓ Removed $entries_count toolkit-related entries from in-memory history" + # Also remove any 'history' commands that might show investigation + echo " → Removing history command traces..." + history_entries=$(history | grep -E '^\s*[0-9]+\s+.*history' | awk '{print $1}' | sort -rn) + history_count=$(echo "$history_entries" | grep -c '^' 2>/dev/null || echo 0) + + for entry_num in $history_entries; do + history -d "$entry_num" 2>/dev/null || true + done + + if [ "$history_count" -gt 0 ]; then + echo " ✓ Removed $history_count history command entries" + fi + # Write cleaned in-memory history back to file history -w