fix(editor): fall back to $EDITOR and defaults when $VISUAL is unset - #122
Merged
maxlandon merged 1 commit intoSep 30, 2026
Merged
Conversation
dbactual
marked this pull request as ready for review
September 27, 2026 15:05
getSystemEditor() returned an empty string when VISUAL was unset, skipping the documented EDITOR fallback and vi/emacs default, which broke edit-and-execute (Ctrl-X Ctrl-E) with 'exec: no command'.
dbactual
force-pushed
the
fix/getsystemeditor-fallback
branch
from
September 27, 2026 15:06
1d68d49 to
f2d6a09
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #122 +/- ##
=======================================
Coverage 39.82% 39.82%
=======================================
Files 60 60
Lines 9595 9594 -1
=======================================
Hits 3821 3821
+ Misses 5680 5679 -1
Partials 94 94 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Member
|
Thanks for the fix ! |
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.
Problem
getSystemEditor()ininternal/editor/editor.goreturned an empty string immediately when$VISUALwas unset, skipping the$EDITORfallback and the vi/emacs default. This brokeedit-and-execute-command(Ctrl-X Ctrl-E) with:This is the common case, since most users set only
$EDITOR.Fix
Check each fallback in order (per the doc comments on
editAndExecuteCommandin emacs.go andeditAndExecutein vim.go) and return the first non-empty value; fall back tovi(oremacswhenemacsDefault) only when both env vars are unset.Testing
go build ./...passes (the package has no tests)VISUALunset andEDITOR=vim, Ctrl-X Ctrl-E now opens vim