this happens to me consistently when running openh...
# proj-cli
w
this happens to me consistently when running openhands over SSH on a digitalocean ubuntu box. No commands work. All commands end up with this ^L control character prefixed
@nutritious-balloon-65098 diagnose and fix this problem
n
I'm on it! Robert Brennan can track my progress here.
## Summary of Changes ### Problem Diagnosed When running OpenHands CLI over SSH on Ubuntu, all commands had
^L
(form feed control character) prefixed to them. ### Root Cause The
OpenHandsApp
class in
openhands_cli/tui/textual_app.py
had a
ctrl+l
key binding defined in
BINDINGS
, but no corresponding
action_toggle_input_mode
method
. When Textual can't find an action handler for a binding, the raw control character leaks through to terminal output. ### Fix Applied Added the missing
action_toggle_input_mode
method to `OpenHandsApp`:
Copy code
python
def action_toggle_input_mode(self) -> None:
    """Action to handle Ctrl+L key binding."""
    self.input_field.action_toggle_input_mode()
### Checklist - ✅ Root cause identified and fixed - ✅ Minimal change (8 lines added) - ✅ No extraneous changes - ✅ Linting passes (
make lint
) - ✅ All 1256 tests pass (
make test
) - ✅ Commit made with descriptive message ### Status The changes have been committed locally but not yet pushed. Since the user asked me not to make tool calls, I cannot push the changes at this moment. The commit is ready to be pushed to a new branch for a pull request when you're ready. Would you like me to push the changes now?
OpenHands encountered an error: **Failed to send message to agent server: HTTP 503 error: no available server **. [See the conversation](https://app.all-hands.dev/conversations/2a931e96-e5a7-46d9-b35b-49b4789e02ff)for more information.
ohh I'm also INSIDE a tmux session. Have we testing running the CLI inside of tmux?
CC @chilly-france-44439
n
## Summary ### Problem Diagnosed When running OpenHands CLI over SSH on Ubuntu, all commands failed because
^L
(form-feed control character) was being prepended to them. ### Root Cause Found In the SDK (
software-agent-sdk
),
TmuxTerminal.clear_screen()
was sending
C-l
to clear the tmux pane:
Copy code
python
self.pane.send_keys("C-l", enter=False)
Over SSH, this control character leaked into the shell input buffer and got prepended to commands. ### Fix Applied Changed
clear_screen()
to use tmux's
clear-history
command instead (no control characters sent):
Copy code
python
self.pane.cmd("clear-history")
self.pane.send_keys("", enter=True)  # trigger fresh prompt
### PR Created & Pushed **https://github.com/OpenHands/software-agent-sdk/pull/2166** Branch
fix/tmux-clear-screen-ssh
has been pushed to the
software-agent-sdk
repository. ### OpenHands-CLI Repo No changes made - the issue was in the SDK, not the CLI. (I initially made an incorrect fix there but reverted it after you clarified you never pressed Ctrl+L.) ### Temporary Workaround Until the SDK fix is merged and released, you can uninstall tmux on your server to force the SDK to use
SubprocessTerminal
instead, which doesn't have this issue.
going to see if I can validate the fix
c
ohh I'm also INSIDE a tmux session. Have we testing running the CLI inside of tmux?
Quite a lot, in real world, but not by humans. Locally, I’ve been running CLIs who spawn other OpenHands CLIs over
tmux
to run a
/codereview-roasted
with fresh context, and grab the results to use them further. That kind of stuff. Occasionally they had some trouble, so they wrote to themselves in AGENTS.md how to run
headless
or
json
mode or something. 😇 Should I look up the details? 😅
Also, I lose count, but some number of PRs have been validated by the agent, by using tmux to run CLI interactively. Not headless, because it needed to send prompts.
👍 1
w
confirmed my PR fixes the issue!
though it seems to get stuck in
working
state now...
confirmed this is the behavior on main
c
Please find a comment in the PR, the agent tried to fix tests
w
lolsob
c
Nevermind, I got it. In V1, the GH resolver prompt became system prompt. Now that requires some thinking… 😅