Add history command removal to trace eraser

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
This commit is contained in:
cschantz
2025-11-10 23:18:16 -05:00
parent 65b4a5e78b
commit 612fd84d3e
+13
View File
@@ -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