Repository navigation
feat(terminal): git commit without -m opens $EDITOR - #2539
Merged
Merged
Conversation
Inside a terminal session git commit with no -m edits .git/COMMIT_EDITMSG in vi (git's template, # lines dropped, empty message or :cq aborts). vi :cq now exits 1. Sessions set EDITOR=vi; other editors are reported as unavailable.
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
bashkit | 426013e | Commit Preview URL Branch Preview URL |
Oct 07 2026, 05:03 AM |
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.
What changed
git commitwithout-mopens the editor on.git/COMMIT_EDITMSG, pre-filled with git's template, as real git does. Saving and quitting commits. Lines starting with#are dropped. An empty message aborts with git's message and exit 1, and so does:cq.vigains:cq, which quits with exit status 1.EDITOR=viwhen it is unset.$VISUAL/$EDITORare honored only as far as namingvi/vim; any other editor is reported as unavailable instead of being silently replaced.git commitwithout-mbehaves as before (error: switch 'm' requires a value).Why
Agents and users driving a terminal hit
$EDITORflows. With this change,git commitbehaves like a real shell instead of failing.git rebase -iandcrontab -eare not covered because neither command exists in bashkit. The newbuiltins::edit_filehelper is the hook for future commands that need an editor.Before / After
Tests:
terminal::tests::{git_commit_without_m_opens_editor, git_commit_editor_abort_paths, vi_cq_exits_nonzero}. The CI terminal step now runs with--features terminal,gitso these tests execute. Locally, all 2856 lib tests pass with--features terminal,git, clippy is clean with and withoutterminal, and the git-only build is clean.Risk
terminalfeature, which is off by default.Checklist
Generated by Claude Code