Skip to content

Commit 5ead214

Browse files
committed
fix: hide cursor during build progress, clear line artifacts
1 parent bbbbab3 commit 5ead214

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

install.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ if [ "$INSTALLED" = false ]; then
9999
echo -e " ${DIM}Compiling (~200 crates, this may take a few minutes)...${NC}"
100100

101101
set +e
102+
printf "\033[?25l" # hide cursor during build
102103
cargo build --release -p rusty-claude-cli 2>&1 | tee "$BUILD_LOG" | {
103104
EST=200
104105
BUILT=0
@@ -109,14 +110,15 @@ if [ "$INSTALLED" = false ]; then
109110
PCT=$((BUILT * 100 / EST))
110111
[ "$PCT" -gt 99 ] && PCT=99
111112
CRATE=$(echo "$line" | sed 's/.*Compiling \([^ ]*\).*/\1/')
112-
printf "\r ${GREEN}[%3d%%]${NC} Compiling ${DIM}%-30s${NC}" "$PCT" "$CRATE"
113+
printf "\r\033[K ${GREEN}[%3d%%]${NC} Compiling ${DIM}%s${NC}" "$PCT" "$CRATE"
113114
;;
114115
*Finished*)
115-
printf "\r ${GREEN}[100%%]${NC} Build complete %-40s\n" " "
116+
printf "\r\033[K ${GREEN}[100%%]${NC} Build complete\n"
116117
;;
117118
esac
118119
done
119120
}
121+
printf "\033[?25h" # restore cursor
120122
BUILD_EXIT=${PIPESTATUS[0]:-$?}
121123
set -e
122124
rm -f "$BUILD_LOG"

0 commit comments

Comments
 (0)