[PR #4634] fix(tui): prevent dead keystrokes when spawning editor #11045

Closed
opened 2026-02-16 18:15:49 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/4634

State: closed
Merged: No


Summary

Fixes the issue where keystrokes become unresponsive after spawning an external editor from the TUI.

Changes

  • Remove stdin listeners before editor spawn to prevent OpenTUI from consuming keystrokes meant for the editor
  • Save and restore terminal settings with stty to maintain proper terminal state
  • Clear screen and reset cursor position to avoid rendering artifacts
  • Explicitly track and restore raw mode state for correct renderer behavior

Testing

  • Tested with various editors (vim, nano, etc.)
  • Verified terminal state is properly restored after editor exits
  • Confirmed no dead keystrokes after returning to TUI
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/4634 **State:** closed **Merged:** No --- ## Summary Fixes the issue where keystrokes become unresponsive after spawning an external editor from the TUI. ## Changes - Remove stdin listeners before editor spawn to prevent OpenTUI from consuming keystrokes meant for the editor - Save and restore terminal settings with `stty` to maintain proper terminal state - Clear screen and reset cursor position to avoid rendering artifacts - Explicitly track and restore raw mode state for correct renderer behavior ## Testing - Tested with various editors (vim, nano, etc.) - Verified terminal state is properly restored after editor exits - Confirmed no dead keystrokes after returning to TUI
yindo added the pull-request label 2026-02-16 18:15:49 -05:00
yindo closed this issue 2026-02-16 18:15:49 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#11045