Skip to content

fix: bypass urwid UI when stdout is not a TTY#8

Open
mktwix wants to merge 1 commit into
hiddify:mainfrom
mktwix:fix/non-tty-bypass-urwid
Open

fix: bypass urwid UI when stdout is not a TTY#8
mktwix wants to merge 1 commit into
hiddify:mainfrom
mktwix:fix/non-tty-bypass-urwid

Conversation

@mktwix

@mktwix mktwix commented Jul 19, 2026

Copy link
Copy Markdown

Summary

When cli_progress wraps install.sh apply_configs / apply_users without a real TTY (non-interactive SSH, cron, background panel jobs), the urwid MainLoop never exits after the subprocess finishes. The process spins indefinitely and blocks subsequent applies.

This leaves sing-box configs stale after Admin API user create/renew even though the panel DB was updated.

Fix

If stdout is not a TTY, run the wrapped command directly via subprocess.call() and skip the urwid UI.

Interactive terminal runs still show the progress UI.

Reproduction

ssh -T root@server 'bash /opt/hiddify-manager/apply_configs.sh'
# cli_progress hangs forever; sing-box may not reload

Related

Verified on production Hiddify Manager 12.3.3 (3 nodes).

Made with Cursor

Without a terminal, cli_progress wraps install/apply in an urwid MainLoop
that never exits after the subprocess finishes. This leaves apply_configs and
apply_users stuck indefinitely and prevents sing-box configs from reloading.

Run the wrapped command directly in non-interactive environments.

Fixes hiddify/Hiddify-Manager#5479

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

1 participant