From 5cfcff0598a7c3466b45ed99f2c760ee6b3f6b2a Mon Sep 17 00:00:00 2001 From: cschantz Date: Tue, 11 Nov 2025 17:47:48 -0500 Subject: [PATCH] Make auto cleanup fast and clean MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changes: - Suppress trace eraser output in auto mode (only show ✓) - Clear screen after cleanup - Leave user in /root directory - Single success message Result: - Question -> yes -> quick cleanup -> ✓ All traces removed -> /root - Fast, minimal output, clean exit --- launcher.sh | 4 ++-- tools/erase-toolkit-traces.sh | 31 ++++++++++++++++--------------- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/launcher.sh b/launcher.sh index 305df4d..1e91471 100755 --- a/launcher.sh +++ b/launcher.sh @@ -1507,8 +1507,8 @@ main() { read -p "Clean history and remove traces? (yes/no): " clean_hist if [ "$clean_hist" = "yes" ]; then - # Run trace eraser in non-interactive mode - TRACE_ERASER_AUTO=yes bash "$BASE_DIR/tools/erase-toolkit-traces.sh" + # Run trace eraser in non-interactive mode (suppress output) + TRACE_ERASER_AUTO=yes bash "$BASE_DIR/tools/erase-toolkit-traces.sh" 2>&1 | grep -E "^✓|^$" || true fi echo "" diff --git a/tools/erase-toolkit-traces.sh b/tools/erase-toolkit-traces.sh index 7fc3b59..69a7bb9 100755 --- a/tools/erase-toolkit-traces.sh +++ b/tools/erase-toolkit-traces.sh @@ -31,9 +31,12 @@ if [ "$TRACE_ERASER_AUTO" != "yes" ]; then fi fi -echo "" -echo "Removing traces..." -echo "" +# Only show progress if not in auto mode +if [ "$TRACE_ERASER_AUTO" != "yes" ]; then + echo "" + echo "Removing traces..." + echo "" +fi # Patterns to remove from history PATTERNS=( @@ -159,13 +162,11 @@ fi # Offer to remove the entire toolkit (AFTER history cleaning) if [ "$TRACE_ERASER_AUTO" = "yes" ]; then - # Auto mode: always remove directory and skip prompt - echo "" - echo "Removing toolkit directory..." - cd /root - rm -rf "$SCRIPT_DIR" - echo "" - echo -e "${GREEN}✓ Toolkit completely removed${NC}" + # Auto mode: quick cleanup, minimal output + cd /root 2>/dev/null + rm -rf "$SCRIPT_DIR" 2>/dev/null + clear + echo -e "${GREEN}✓ All traces removed${NC}" else # Manual mode: ask user echo "" @@ -190,9 +191,9 @@ else echo "Toolkit directory remains at: $SCRIPT_DIR" echo "You can manually remove it later with: rm -rf $SCRIPT_DIR" fi -fi -echo "" -echo "All traces removed. The trace eraser commands will also be" -echo "removed when you log out or start a new shell session." -echo "" + echo "" + echo "All traces removed. The trace eraser commands will also be" + echo "removed when you log out or start a new shell session." + echo "" +fi