browser-use--browser-harness
29fa06576c
A bare `bh` invocation blocks forever on sys.stdin.read(). Detect a TTY stdin and exit with a one-line usage hint instead, so the failure mode is obvious. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
16 行
288 B
Python
16 行
288 B
Python
import sys
|
|
|
|
from admin import ensure_daemon
|
|
from helpers import *
|
|
|
|
|
|
def main():
|
|
if sys.stdin.isatty():
|
|
sys.exit("bh reads Python from stdin. Use:\n bh <<'PY'\n print(page_info())\n PY")
|
|
ensure_daemon()
|
|
exec(sys.stdin.read())
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|