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

Closed
opened 2026-02-16 18:09:37 -05:00 by yindo · 1 comment
Owner

Originally created by @aree6 on GitHub (Feb 2, 2026).

Originally assigned to: @kommander on GitHub.

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.

Originally created by @aree6 on GitHub (Feb 2, 2026). Originally assigned to: @kommander on GitHub. ### Feature hasn't been suggested before. - [x] 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](https://github.com/user-attachments/assets/409ba5dd-851d-4597-9beb-0fa3d0e2b4a3) ### 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` - The cursor rendering uses `Reverse(true)` to create the block effect - https://github.com/charmbracelet/bubbles/blob/master/cursor/cursor.go 2. **Opencode usage** - `internal/tui/components/chat/editor.go` - Creates the textarea component using bubbles with default cursor settings - https://github.com/anomalyco/opencode/blob/main/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: - **Claude Code**: Has a similar issue where it overrides terminal cursor settings - https://github.com/anthropics/claude-code/issues/674 - **Ghostty discussions**: Multiple users have reported cursor style being overridden by TUI applications - https://github.com/ghostty-org/ghostty/discussions/5144 - https://github.com/ghostty-org/ghostty/discussions/3893 ### Related opencode issues - **Cursor blinking issue**: Terminal cursor blinks in opencode even though it shouldn't - https://github.com/anomalyco/opencode/issues/1905 ### 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.
yindo added the opentuidiscussion labels 2026-02-16 18:09:37 -05:00
yindo closed this issue 2026-02-16 18:09:37 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Feb 2, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #11305: feat: add configurable cursor style for TUI textareas (virtually identical feature request with same proposed solution)
  • #11433: Cursor does not reset in some terminals (related cursor reset issue)
  • #1905: Terminal cursor blinks in opencode even though it shouldn't (related cursor behavior)
  • #5364: Non-blinking caret / cursor (related cursor control request)

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Feb 2, 2026): This issue might be a duplicate of existing issues. Please check: - #11305: feat: add configurable cursor style for TUI textareas (virtually identical feature request with same proposed solution) - #11433: Cursor does not reset in some terminals (related cursor reset issue) - #1905: Terminal cursor blinks in opencode even though it shouldn't (related cursor behavior) - #5364: Non-blinking caret / cursor (related cursor control request) Feel free to ignore if none of these address your specific case.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#8293