Skip to content

fix: skip terminal compatibility check in headless mode#592

Draft
rbren wants to merge 1 commit intomainfrom
fix/skip-terminal-check-in-headless-mode
Draft

fix: skip terminal compatibility check in headless mode#592
rbren wants to merge 1 commit intomainfrom
fix/skip-terminal-check-in-headless-mode

Conversation

@rbren
Copy link

@rbren rbren commented Mar 15, 2026

Summary

When running in headless mode, the CLI was displaying a confusing warning about Rich detecting a non-interactive terminal:

OpenHands CLI terminal UI may not work correctly in this environment: Rich detected a non-interactive or unsupported terminal; interactive UI may not render correctly
To override Rich's detection, you can set TTY_INTERACTIVE=1 (and optionally TTY_COMPATIBLE=1).

This warning is unnecessary in headless mode since there's no interactive UI to render anyway.

Changes

  • Modified openhands_cli/entrypoint.py to wrap the terminal compatibility check in a if not args.headless: condition
  • The check is now only performed when running in interactive (non-headless) mode

Verification

  • make lint passes
  • tests/test_terminal_compat.py tests pass

🚀 Try this PR

uvx --python 3.12 git+https://github.com/OpenHands/OpenHands-CLI.git@fix/skip-terminal-check-in-headless-mode

In headless mode, we don't need an interactive terminal since
there's no UI to render. Skip the Rich terminal detection check
to avoid confusing warnings about non-interactive terminals.

Co-authored-by: openhands <openhands@all-hands.dev>
@github-actions
Copy link
Contributor

Coverage

Coverage Report •
FileStmtsMissCoverMissing
openhands_cli
   entrypoint.py1244563%32, 52–53, 56, 59, 61–62, 64–65, 68, 70, 72, 76, 81, 83–84, 133, 135–136, 139–143, 146–147, 149, 151, 161, 163–165, 167, 169–171, 174, 176, 180, 189, 191–193, 213, 260
TOTAL664091986% 

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.

2 participants