Skip to content

fix: argument list too long on shells without a builtin printf - #1911

Closed
U-L-M-S wants to merge 2 commits into
pystardust:masterfrom
U-L-M-S:fix-external-printf-arg-limit
Closed

U-L-M-S wants to merge 2 commits into
pystardust:masterfrom
U-L-M-S:fix-external-printf-arg-limit

Conversation

@U-L-M-S

@U-L-M-S U-L-M-S commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Type of change

  • Bug fix

Description

Fixes #1906.

The reporter's shell is mksh, the /bin/sh of Android. It has no builtin printf, so printf "%s" "$_response" runs an external printf with the whole page as one argument. Linux allows 128KiB per argument, the search page is 250KiB, so it fails with Argument list too long.

Fix: a small print_page helper prints through a here-document. The shell writes that itself, so there is no limit. It is used only where whole pages are printed.

Why Termux users end up in mksh: ani-cli -U rewrites the package's shebang to #!/bin/sh, which is mksh on Android. That is a separate issue and not touched here.

Tested with mksh on Android (Termux) and in docker with mksh, dash, bash and busybox: master fails, this branch works.

Checklist

  • any anime playing
  • bumped version

  • next, prev, replay and select work
  • -c history and continue work
  • -d downloads work
  • -e (select episode) aka -r (range selection) works
  • -S select index works
  • -q quality works
  • -s syncplay works (not installed)
  • -v vlc works (not installed)
  • --dub and regular (sub) mode both work
  • --nextep-countdown countdown to next ep works

  • -h help info is up to date
  • Readme is up to date
  • Man page is up to date

Shells like mksh run an external printf, which cannot take a 250KiB page as a single argument. A here-document has no such limit.
Same explanation in three plain lines.
@port19x

port19x commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

Closing this because it is caused by user error in my opinion as laid out in the linked issue.

@port19x port19x closed this Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ani-cli in a 'Scriptrunner for Termux' script does not work with parameters since 5.1.1

2 participants