Skip to content

feat(tui): added hardware cursor positioning#719

Closed
can1357 wants to merge 1 commit intobadlogic:mainfrom
can1357:main
Closed

feat(tui): added hardware cursor positioning#719
can1357 wants to merge 1 commit intobadlogic:mainfrom
can1357:main

Conversation

@can1357
Copy link
Copy Markdown
Contributor

@can1357 can1357 commented Jan 14, 2026

hw cursor brrr

- Added hardware cursor positioning support to TUI components.
- Added getCursorPosition() method to Component interface for cursor coordinate reporting.
- Added input queuing during terminal cell size detection to prevent input loss.
- Fixed cursor positioning calculations for multi-byte Unicode characters in input and editor components.
- Fixed race condition between cell size detection and component rendering.
- Fixed cursor visibility when autocomplete is active in editor component.
@badlogic
Copy link
Copy Markdown
Owner

Part of the solution for #525

Needs vetting on my end. Cursor stuff is brittle.

@badlogic
Copy link
Copy Markdown
Owner

Implemented via a cleaner marker-based approach in 07fad13. The hardware cursor now follows the text cursor for IME support.

Key differences from the original PR:

  • Uses Focusable interface instead of getCursorPosition() on all components
  • Components emit CURSOR_MARKER (zero-width APC sequence) in render output when focused
  • TUI scans for marker after compositing, extracts position, strips marker
  • No need for Container to track child positions

Thanks @can1357 for the initial implementation that inspired this solution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants