opencode icon indicating copy to clipboard operation
opencode copied to clipboard

feat(tui): add configurable status line hints

Open 0xktn opened this issue 4 days ago • 1 comments

What does this PR do?

Adds support for customizable status hints in the TUI footer, allowing users to control which keybind hints are displayed.

Features:

  • New tui.status_hints config section with enabled flag and items array
  • Default hints: agent_cycle, variant_cycle (conditional), command_list
  • Conditional hint display (e.g., variant_cycle only shows when variants exist)
  • Users can customize which hints to show and their labels
  • Backwards compatible - uses defaults when not configured

Example Configuration:

{
  "tui": {
    "status_hints": {
      "enabled": true,
      "items": [
        { "keybind": "agent_cycle", "label": "switch agent" },
        { "keybind": "variant_cycle", "label": "switch variants", "when": "hasVariants" },
        { "keybind": "command_list", "label": "commands" }
      ]
    }
  }
}

This implementation follows the design proposed in issue #6240.

Closes #6240

How did you verify your code works?

  1. Built locally: Ran ./packages/opencode/script/build.ts --single to verify build success.
  2. Tested Defaults: Verified that running without config shows the default hints (Agent, Variant (if available), Commands).
  3. Tested Variant Logic: Verified variant_cycle hint appears only when a model with variants (e.g., antigravity-claude-opus-4-5-thinking) is selected, and hides for others.
  4. Tested Custom Config: Verified that OPENCODE_CONFIG with status_hints correctly changes the footer order and labels.

0xktn avatar Jan 11 '26 03:01 0xktn