Prefer a browser-based terminal workflow through ttyd in a browser that OpenClaw can control before falling back to direct local shell execution. Use when the user asks to "use terminal", wants commands run visibly in a web terminal, prefers browser terminal interaction, or wants a human-in-the-loop workflow where the user may manually handle sensitive prompts like passwords.
Prefer the browser terminal first for shell tasks when visible, browser-based execution is part of the user's workflow.
Before using this workflow, verify that OpenClaw browser control is actually available in the current environment.
The agent must be able to:
If browser control is unavailable, disabled, or not permitted, do not pretend the browser-terminal path is ready. Tell the user or fall back to another approved workflow.
ttyd --writable -p <port> <shell>http://127.0.0.1:<port>/zsh or bashpwsh or powershellFor ttyd/xterm.js terminals, ordinary browser type/fill can be flaky.
Prefer this order:
window.term.paste('pwd\\r')Before executing risky operations, pause and require the user's explicit confirmation word:
confrimTreat these as risky:
sudo or privileged/system-changing commandsIf the risky action also produces a password prompt, let the user manually enter the password. Never ask for, store, or process the password content directly.
Use direct local exec instead when:
After sending a command, confirm one of these:
Do not claim the browser terminal command worked unless the output or terminal state confirms it.
references/troubleshooting.md.references/windows-ttyd.md.