Skip to content

fix: bypass cli_progress wrapper when stdout is not a TTY#5506

Open
mktwix wants to merge 1 commit into
hiddify:devfrom
mktwix:fix/non-tty-bypass-cli-progress
Open

fix: bypass cli_progress wrapper when stdout is not a TTY#5506
mktwix wants to merge 1 commit into
hiddify:devfrom
mktwix:fix/non-tty-bypass-cli-progress

Conversation

@mktwix

@mktwix mktwix commented Jul 19, 2026

Copy link
Copy Markdown

Summary

apply_configs / apply_users hang indefinitely when invoked without a TTY because show_progress_window() always wraps the command in python -m cli_progress (urwid UI). The subprocess may finish and regenerate configs, but the wrapper never exits and can block later applies (exit 12 lock).

Impact: After Admin API user renew, panel DB is correct but sing-box protocols (Hy2/TUIC/Mieru/Naive) stay stale until manual SSH intervention.

Fix

In show_progress_window(), detect non-TTY stdout ([ ! -t 1 ]) and run the wrapped install/apply command directly, skipping cli_progress.

Interactive installs still use the progress UI.

Reproduction

ssh -T root@server 'bash /opt/hiddify-manager/apply_configs.sh'
pgrep -af cli_progress   # stuck 15+ minutes, 0-byte install log
systemctl show hiddify-singbox -p ActiveEnterTimestamp  # unchanged

Manual workaround that worked: kill cli_progress, run commander.py apply-users, restart sing-box.

Related

Fixes #5479
Related: #5505, #5498, #4926

Companion PR: hiddify/cli_progress#TBD

Verified on production 12.3.3 across Montreal / Helsinki / Nuremberg.

Made with Cursor

apply_configs / apply_users invoked over non-interactive SSH or from background
jobs hang forever in cli_progress urwid, leaving sing-box configs stale after
Admin API user renewals.

When stdout is not a terminal, run the wrapped install/apply command directly.

Fixes hiddify#5479
Related: hiddify#5505

Co-authored-by: Cursor <cursoragent@cursor.com>
@mktwix

mktwix commented Jul 19, 2026

Copy link
Copy Markdown
Author

Companion fix in cli_progress package: hiddify/cli_progress#8

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.

Apply Configuration hangs forever when run without a TTY (cli_progress urwid loop never exits)

1 participant