qwen-code/integration-tests/terminal-capture/scenarios/progress.sh
tanzhenxin df20ec9871 feat(terminal-capture): add streaming-insight scenario and simplify GIF timing
- Add streaming-insight scenario for /insight command demo
- Add progress.sh script to test PTY carriage return handling
- Simplify generateGif with fixed frame durations (300ms normal, 1s edges)

This enhances terminal capture testing with a real-world streaming scenario
and cleaner GIF generation logic.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-05 19:13:28 +08:00

16 lines
No EOL
473 B
Bash
Executable file

#!/bin/bash
# Progress bar script that overwrites the same line using \r
# Tests PTY's ability to handle carriage return / cursor movement
total=20
for ((i = 1; i <= total; i++)); do
pct=$((i * 100 / total))
filled=$((pct / 5))
empty=$((20 - filled))
bar=$(printf '%0.s#' $(seq 1 $filled 2>/dev/null))
space=$(printf '%0.s-' $(seq 1 $empty 2>/dev/null))
printf "\r[%s%s] %3d%% (%d/%d)" "$bar" "$space" "$pct" "$i" "$total"
sleep 0.5
done
echo ""
echo "Done!"