Feature hasn't been suggested before.
Describe the enhancement you want to request
Running opencode shows a blank terminal until the CLI, the server worker, plugins and providers have loaded. That takes 2-5 s on a fast machine, longer under load or with many plugins (see #46976, #48051). Two things go wrong while it loads:
- You can't start typing. Keys typed meanwhile are echoed by the tty in cooked mode, so they appear as raw text on the blank screen. An Enter becomes a line feed, and an early paste can be mangled.
- You don't see anything that looks like OpenCode until the very end.
Proposal: paint the home screen with a working prompt the moment opencode starts, before anything else loads.
- The entrypoint puts the tty in raw mode at once, reads
tui.json with plain file I/O, and paints the same home screen at the same positions: logo, prompt box with placeholder, tab agents / ctrl+p commands, cwd and version in the footer, plus a small "Loading…" spinner.
- The agent, model, variant and theme colors come from a small cache the TUI writes on each run. The cache sits beside the database the process would open (
opencode.tui-startup.json next to opencode.db), so OPENCODE_DB, data directories and channels never share one. Nothing on this path opens SQLite.
- The prompt is a real editor: the
input_* keybinds including tui.json overrides, word wrap, click to move the caret, selection, paste and undo. A worker thread reads and paints keys while the main thread is still evaluating the CLI; the main thread alone can't, since module evaluation blocks it for 0.3-1.7 s.
- When the TUI's renderer starts, the typed text, caret and selection hand over to the real prompt exactly. Nothing visibly changes except the model line and tips filling in.
- Enter while loading shows "OpenCode still loading, will submit shortly" under the prompt and submits once loaded, but only if the agent/model/variant that loads matches the cached one shown. Otherwise it shows "Not submitted: agent/model/variant changed" in red, and you press Enter again.
--mini and startup.instant_prompt: false keep only the invisible part: early keys are captured and placed in the prompt when it appears, and an Enter typed during startup is dropped (startup.early_input).
Measured with a pty harness, --pure, the screen is typable 70-140 ms after opencode is run on Linux x64 and two Apple Silicon Macs, versus 2-5 s before. Keystroke-to-paint while loading is about 10 ms median.
I have a working implementation and will open a PR referencing this issue. It also moves the home and prompt layout numbers into a constants-only module (packages/tui/src/layout.ts) and the keybind defaults into config/keybind-definitions.ts, so the early screen and the real TUI read the same values.
Feature hasn't been suggested before.
Describe the enhancement you want to request
Running
opencodeshows a blank terminal until the CLI, the server worker, plugins and providers have loaded. That takes 2-5 s on a fast machine, longer under load or with many plugins (see #46976, #48051). Two things go wrong while it loads:Proposal: paint the home screen with a working prompt the moment
opencodestarts, before anything else loads.tui.jsonwith plain file I/O, and paints the same home screen at the same positions: logo, prompt box with placeholder,tab agents/ctrl+p commands, cwd and version in the footer, plus a small "Loading…" spinner.opencode.tui-startup.jsonnext toopencode.db), soOPENCODE_DB, data directories and channels never share one. Nothing on this path opens SQLite.input_*keybinds includingtui.jsonoverrides, word wrap, click to move the caret, selection, paste and undo. A worker thread reads and paints keys while the main thread is still evaluating the CLI; the main thread alone can't, since module evaluation blocks it for 0.3-1.7 s.--miniandstartup.instant_prompt: falsekeep only the invisible part: early keys are captured and placed in the prompt when it appears, and an Enter typed during startup is dropped (startup.early_input).Measured with a pty harness,
--pure, the screen is typable 70-140 ms afteropencodeis run on Linux x64 and two Apple Silicon Macs, versus 2-5 s before. Keystroke-to-paint while loading is about 10 ms median.I have a working implementation and will open a PR referencing this issue. It also moves the home and prompt layout numbers into a constants-only module (
packages/tui/src/layout.ts) and the keybind defaults intoconfig/keybind-definitions.ts, so the early screen and the real TUI read the same values.