fix(spinner): show spinner during logged phase without ANSI code leaks
- commit
- 1057d32318083e899da56aa584409699f0490708
- author
- bnema · · 2025-10-21 18:55 UTC
- committer
- bnema · · 2025-10-21 20:54 UTC
- parent
- b7b5570
- signature
- unsigned
3 files · +3 -5
M CHANGELOG.md +1 -0
| @@ -16,6 +16,7 @@ All notable changes to this project will be documented in this file. | |||
| 16 | 16 | ### Fixed | |
| 17 | 17 | - **Download script**: Added missing extra.packages to download list | |
| 18 | 18 | - **UFW setup**: Moved firewall configuration to post-boot to avoid kernel module errors in chroot | |
| 19 | + | - **Spinner visibility**: Fixed gum spinner not showing during logged phase by redirecting stderr to /dev/tty | |
| 19 | 20 | ||
| 20 | 21 | ### Changed | |
| 21 | 22 | - **Disk selection**: Enhanced disk listing with model, serial, and vendor information using JSON output | |
| @@ -16,6 +16,7 @@ All notable changes to this project will be documented in this file. | |||||
| 16 | ### Fixed | 16 | ### Fixed | ||
| 17 | - **Download script**: Added missing extra.packages to download list | 17 | - **Download script**: Added missing extra.packages to download list | ||
| 18 | - **UFW setup**: Moved firewall configuration to post-boot to avoid kernel module errors in chroot | 18 | - **UFW setup**: Moved firewall configuration to post-boot to avoid kernel module errors in chroot | ||
| 19 | + | - **Spinner visibility**: Fixed gum spinner not showing during logged phase by redirecting stderr to /dev/tty | |||
| 19 | 20 | ||||
| 20 | ### Changed | 21 | ### Changed | ||
| 21 | - **Disk selection**: Enhanced disk listing with model, serial, and vendor information using JSON output | 22 | - **Disk selection**: Enhanced disk listing with model, serial, and vendor information using JSON output | ||
M install/base/pacman.sh +0 -4
| @@ -1,11 +1,7 @@ | |||
| 1 | 1 | #!/bin/bash | |
| 2 | 2 | # Configure ISO pacman for faster downloads | |
| 3 | 3 | ||
| 4 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Configuring pacman..." | |
| 5 | - | ||
| 6 | 4 | # Enable ParallelDownloads on ISO | |
| 7 | 5 | sed -i 's/^#ParallelDownloads = 5$/ParallelDownloads = 10/' /etc/pacman.conf | |
| 8 | 6 | ||
| 9 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Pacman configured for fast downloads" | |
| 10 | - | ||
| 11 | 7 | echo "ISO Pacman configured: ParallelDownloads=10" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| @@ -1,11 +1,7 @@ | |||||
| 1 | #!/bin/bash | 1 | #!/bin/bash | ||
| 2 | # Configure ISO pacman for faster downloads | 2 | # Configure ISO pacman for faster downloads | ||
| 3 | 3 | ||||
| 4 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Configuring pacman..." | |||
| 5 | - | ||||
| 6 | # Enable ParallelDownloads on ISO | 4 | # Enable ParallelDownloads on ISO | ||
| 7 | sed -i 's/^#ParallelDownloads = 5$/ParallelDownloads = 10/' /etc/pacman.conf | 5 | sed -i 's/^#ParallelDownloads = 5$/ParallelDownloads = 10/' /etc/pacman.conf | ||
| 8 | 6 | ||||
| 9 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Pacman configured for fast downloads" | |||
| 10 | - | ||||
| 11 | echo "ISO Pacman configured: ParallelDownloads=10" >> "$ARCHUP_INSTALL_LOG_FILE" | 7 | echo "ISO Pacman configured: ParallelDownloads=10" >> "$ARCHUP_INSTALL_LOG_FILE" | ||
M install/helpers/presentation.sh +2 -1
| @@ -82,9 +82,10 @@ run_with_spinner() { | |||
| 82 | 82 | local command="$2" | |
| 83 | 83 | ||
| 84 | 84 | # Run command with spinner, output goes only to log file | |
| 85 | + | # Spinner UI (stderr) goes to /dev/tty so it's always visible even when stdout is redirected | |
| 85 | 86 | # If command fails, error will be caught by ERR trap and shown in error handler | |
| 86 | 87 | if gum spin --spinner dot --title "$title" -- \ | |
| 87 | - | bash -c "$command >> \"$ARCHUP_INSTALL_LOG_FILE\" 2>&1"; then | |
| 88 | + | bash -c "$command >> \"$ARCHUP_INSTALL_LOG_FILE\" 2>&1" 2>/dev/tty; then | |
| 88 | 89 | return 0 | |
| 89 | 90 | else | |
| 90 | 91 | return 1 | |
| @@ -82,9 +82,10 @@ run_with_spinner() { | |||||
| 82 | local command="$2" | 82 | local command="$2" | ||
| 83 | 83 | ||||
| 84 | # Run command with spinner, output goes only to log file | 84 | # Run command with spinner, output goes only to log file | ||
| 85 | + | # Spinner UI (stderr) goes to /dev/tty so it's always visible even when stdout is redirected | |||
| 85 | # If command fails, error will be caught by ERR trap and shown in error handler | 86 | # If command fails, error will be caught by ERR trap and shown in error handler | ||
| 86 | if gum spin --spinner dot --title "$title" -- \ | 87 | if gum spin --spinner dot --title "$title" -- \ | ||
| 87 | - | bash -c "$command >> \"$ARCHUP_INSTALL_LOG_FILE\" 2>&1"; then | 88 | + | bash -c "$command >> \"$ARCHUP_INSTALL_LOG_FILE\" 2>&1" 2>/dev/tty; then |
| 88 | return 0 | 89 | return 0 | ||
| 89 | else | 90 | else | ||
| 90 | return 1 | 91 | return 1 | ||