Ray's Knowledge Base
Unlock

The rgit TUI commit popup vanishes on a hook failure when commit.gpgsign is on

PitfallVerified 30 Sep 2026Holds project: rgit
Pitfall. The symptom, what causes it, and the fix that was run and seen to work.

Symptom#

In the rgit TUI, a commit with a failing pre-commit hook shows the hook line for a moment. Then the popup disappears. The "failed" state, with e retry / q dismiss, never appears. The rgit CLI is fine.

Cause#

The user's ~/.config/git/config sets commit.gpgsign=true. The TUI special-cased signed commits: CommitEditorSubmit took the gpg_sign branch (Effect::RunGit), which suspends the TUI and runs rgit --human commit -m … in the foreground. The hook output scrolled past in the terminal, and only a short banner "! committing exited with a non-zero status" stayed. The hook console, which holds its output on failure, was never used. A unit test said failure holds the console, because it did not use the signing branch.

Fix#

Do not special-case signing. CommitEditorSubmit always opens the hook console, and Effect::CommitConsole has a sign field. commit_console in crates/rgit-tui/src/runtime.rs signs natively through backend.commit_with(..., sign, no_verify: true). The native signer is the code the CLI uses, and it honors gpg.format and commit.gpgsign. The test that drives this in a pty is in the TUI pty recipe.

Evidence#

Reproduced in a pty with a failing pre-commit hook and commit.gpgsign=true: after Ctrl-S only the hook line appeared and then the console vanished. After the fix the output streamed into the docked console, "✗ failed" held with e retry / q dismiss, retry reopened the editor with the message intact, and a good commit still closed the console. All 45 rgit-tui tests passed.

Also found by searching

  • rgit TUI: ! committing exited with a non-zero status, hook output scrolls away, no retry popup
  • the commit popup in the git TUI disappears when the pre-commit hook fails
  • why does the rgit TUI not show the failed state with e retry when my hook fails
  • commit.gpgsign=true makes TUI suspend and run commit in foreground, hook console bypassed
  • rgit tui commit popup disappears when pre-commit hook fails, no retry prompt
  • tui commit with failing hook shows banner committing exited with a non-zero status then nothing
  • why does the CLI show the hook failure but the TUI popup just vanishes with gpgsign true
  • e retry / q dismiss failed state never appears in rgit commit editor, signed commit suspends tui