Skip to content

[FEATURE]: Allow changing cursor style from block to bar/line #11738

Description

@aree6

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Opencode's TUI has a default block cursor, it would be really nice to have bar/line cursor (like |) also.
Even better would be an option to just use whatever cursor style my terminal is already configured with.
Image

Current behavior

  • In regular Ghostty: cursor is a bar |
  • In opencode TUI: cursor is a block █ (overrides my terminal setting)

I tried adding shell-integration-features = no-cursor in addition to cursor-style = bar to my Ghostty config as suggested in Ghostty discussions, but opencode still shows a block cursor.

What would be nice

Options to choose between:

  • Block (current default)
  • Bar/line (my preference)
  • Underline (bonus)
  • Terminal default (use whatever the terminal is configured with)

Technical details (discovered with AI assistance)

Note: The following technical analysis was done with the help of an AI assistant exploring the opencode codebase

Why this happens:
Opencode uses the charmbracelet/bubbles library for its TUI components. The cursor is hardcoded to "block" style in that library using color inversion (Reverse(true)).

Relevant code locations:

  1. Upstream dependency - charmbracelet/bubbles/cursor/cursor.go

  2. Opencode usage - internal/tui/components/chat/editor.go

Possible approaches:

  1. Request the upstream charmbracelet/bubbles library add support for different cursor shapes
  2. Implement a custom cursor component in opencode that supports block/bar/underline styles
  3. Support DECSCUSR escape sequences for terminals that handle cursor styling natively

Similar issues in other projects

This isn't unique to opencode - other TUI apps have faced similar cursor override issues:

Related opencode issues

Environment

  • Terminal: Ghostty
  • Config tried: cursor-style = bar + shell-integration-features = no-cursor
  • Result: Still seeing block cursor in opencode TUI

Thanks for considering this! Let me know if you need any more info.

Metadata

Metadata

Assignees

Labels

discussionUsed for feature requests, proposals, ideas, etc. Open discussionopentuiThis relates to changes in v1.0, now that opencode uses opentui

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions