when running headless, I get ```OpenHands CLI term...
# proj-cli
w
when running headless, I get
Copy code
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).
we should probably skip this check in headless mode
@nutritious-balloon-65098 make it so
n
I'm on it! Robert Brennan can track my progress here.
## Summary I fixed the issue where the terminal compatibility warning was shown in headless mode. ### Changes Made File:
openhands_cli/entrypoint.py
Wrapped the terminal compatibility check in
if not args.headless:
to skip the Rich terminal detection when running in headless mode. This is appropriate because headless mode doesn't render an interactive UI, so there's no need to verify terminal compatibility. ### Checklist - ✅ Request addressed: Warning is now skipped in headless mode - ✅ Concise changes: Only added a single conditional wrapper (3 lines changed, no extraneous modifications) - ✅ Lint passes:
make lint
completed successfully - ✅ Tests pass:
tests/test_terminal_compat.py
passes ### Commit
Copy code
fix: skip terminal compatibility 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.
### Next Step The changes are committed locally but not yet pushed. Would you like me to push to a remote branch and create a PR?
w
@nutritious-balloon-65098 open a pull request
n
## Summary I successfully fixed the issue where a confusing terminal compatibility warning was displayed when running the CLI in headless mode. ### Problem When running with
--headless
, users would see:
Copy code
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).
### Solution Modified
openhands_cli/entrypoint.py
to skip the terminal compatibility check when
--headless
is enabled, since no interactive UI is needed in that mode. ### Changes Made - File:
openhands_cli/entrypoint.py
- Change: Wrapped the terminal compatibility check in
if not args.headless:
(3 lines of condition added, existing code indented) ### Verification - ✅
make lint
passes - ✅
tests/test_terminal_compat.py
passes ### Pull Request PR #592: https://github.com/OpenHands/OpenHands-CLI/pull/592 Branch:
fix/skip-terminal-check-in-headless-mode
→
main