fix: show cursor when opening squash/PR editor from TUI - #77
Merged
Conversation
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
approved these changes
May 5, 2026
simtel12
deleted the
pgit/gregorios-leach/fix--show-cursor-when-opening-squash-pr-editor-fro
branch
May 5, 2026 19:32
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
LeaveAlternateScreenin the normal exit path and in the panic hook, emitcursor::Showso we never hand off to the shell or hooks with the cursor still hidden.prepare_terminal_for_external_editor(), which runsShowandDisableBracketedPaste, then flushes stdout—called before spawning$EDITORin 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.