#633

[Bug] Progress bar causes excessive blank lines in Apple Terminal on macOS

Openvplkosopened 8d ago

What happened?

When downloading a large app with ipatool v2.7.0 directly (without any wrapper script), the progress display appears at the bottom of the terminal while a large blank area develops above it. The terminal scrolls unexpectedly instead of keeping the progress bar on a single line.

The download itself is progressing; for example, I observed approximately 14% (435 MB / 2.9 GB) at around 1.6 MB/s when the issue occurred.

Environment

  • OS: macOS
  • Hardware: MacBook Pro with Apple M4 (Apple Silicon)
  • Terminal: Apple Terminal (built-in)
  • Shell: zsh
  • TERM=xterm-256color
  • TERM_PROGRAM=Apple_Terminal
  • COLORTERM=truecolor
  • ipatool version: 2.7.0

Steps to reproduce

  1. Authenticate with ipatool auth login.
  2. Run a direct download command, without a wrapper script:
    ipatool download --app-id 989673964 --platform iphone --output "$HOME/Downloads/王者荣耀.ipa"
  3. Observe the terminal while the download is in progress.

Expected behavior

The progress bar should refresh in place on one line without creating a large blank area or causing unexpected scrolling.

Actual behavior

The progress bar appears at the bottom of the terminal, while a large blank area develops above it and the terminal scrolls as the download progresses. This also occurs when running ipatool directly, so it is not caused by a wrapper script.

Code investigation

In cmd/download.go for v2.7.0, the progress bar uses github.com/schollz/progressbar/v3 with, among other options:

  • progressbar.OptionFullWidth()
  • progressbar.OptionSetRenderBlankState(true)
  • progressbar.OptionSetWidth(20)

I have not confirmed the root cause. These options are only potential leads; it may be worth checking the dependency's terminal-width handling, blank-state rendering, carriage-return behavior, and cursor positioning, especially with OptionFullWidth() and OptionSetRenderBlankState(true) enabled together.

I previously reported a related issue in #619, but the issue was closed because the maintainer could not reproduce it. I am opening this report to provide a more specific code-level investigation lead, not to claim that these options are the confirmed cause.

Activity

0

No activity yet.