Skip to content

feat: hide cursor when process loses focus#14

Open
wubin1989 wants to merge 2 commits intomainfrom
upstream-open-pr-227
Open

feat: hide cursor when process loses focus#14
wubin1989 wants to merge 2 commits intomainfrom
upstream-open-pr-227

Conversation

@wubin1989
Copy link
Copy Markdown
Owner

Migrated open PR from upstream for local review.

Upstream: opencode-ai#227
Upstream head: Schniz:schniz/dont-blink-cursor-on-tmux-blur @ 5a00a2a

Schniz and others added 2 commits June 11, 2025 10:23
Implement tmux focus-aware cursor control to reduce visual distraction when switching between tmux panes. The cursor now automatically hides when the OpenCode pane is not focused and reappears when returning to it.

Key changes:
- Add tmux detection utilities using $TMUX and $TMUX_PANE environment variables
- Implement real-time focus monitoring with 500ms polling interval
- Control cursor visibility in textarea component using cursor.CursorHide/CursorBlink modes
- Add TmuxFocusMsg for communicating focus changes between components
- Set initial cursor state based on current tmux focus status

The implementation gracefully falls back to normal behavior when not running in tmux.

🤖 Generated with opencode
Co-Authored-By: opencode <noreply@opencode.ai>
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