Skip to content

fix: show cursor when opening squash/PR editor from TUI - #77

Merged
hokwangchoi merged 1 commit into
hokwangchoi:masterfrom
simtel12:pgit/gregorios-leach/fix--show-cursor-when-opening-squash-pr-editor-fro
May 5, 2026
Merged

fix: show cursor when opening squash/PR editor from TUI#77
hokwangchoi merged 1 commit into
hokwangchoi:masterfrom
simtel12:pgit/gregorios-leach/fix--show-cursor-when-opening-squash-pr-editor-fro

Conversation

@simtel12

@simtel12 simtel12 commented May 5, 2026

Copy link
Copy Markdown

Summary

Fixes the terminal ending up without a visible cursor (and odd bracketed-paste behavior) when opening an external editor from the TUI—especially after squash or submit flows where nano/vim/etc. are spawned.

Problem

Ratatui hides the cursor while rendering. Leaving the alternate screen does not always restore a visible cursor on every terminal; combined with full-screen redraws, users could land in the editor with no visible caret. Bracketed paste could also remain enabled in ways that confuse CLI editors.

What changed

  • After LeaveAlternateScreen in the normal exit path and in the panic hook, emit cursor::Show so we never hand off to the shell or hooks with the cursor still hidden.
  • Introduce prepare_terminal_for_external_editor(), which runs Show and DisableBracketedPaste, then flushes stdout—called before spawning $EDITOR in squash and submit handlers so nano/vim show a normal cursor and paste mode.

Files

  • src/tui/mod.rs — terminal preparation for external editors and safer teardown after TUI.

Restore cursor visibility and disable bracketed paste after leaving the
alternate screen, in the panic hook, and immediately before spawning
$EDITOR for squash and submit flows.

Made-with: Cursor
@hokwangchoi
hokwangchoi merged commit 4164daa into hokwangchoi:master May 5, 2026
1 check passed
@simtel12
simtel12 deleted the pgit/gregorios-leach/fix--show-cursor-when-opening-squash-pr-editor-fro branch May 5, 2026 19:32
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.

3 participants