Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions cli_progress/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@


import argparse
import subprocess
import sys

from .progress_ui import ProgressUI

Expand Down Expand Up @@ -33,6 +35,17 @@ def parse_arguments():
def main():
args = parse_arguments()

# Without a TTY, urwid's MainLoop never exits after the subprocess finishes
# (see hiddify/Hiddify-Manager#5479). Run the wrapped command directly.
if not sys.stdout.isatty():
cmd = args.command
if cmd and cmd[0] == "--":
cmd = cmd[1:]
if not cmd:
print("cli_progress: no command provided", file=sys.stderr)
raise SystemExit(2)
raise SystemExit(subprocess.call(cmd))

ui = ProgressUI(args.log, args.command, args.title, args.subtitle, args.regex)
ui.start()

Expand Down