fix: bd edit now parses EDITOR with args (GH#987)
Parse $EDITOR value to handle editors that need flags like "zeditor --wait" or "code --wait". Previously the entire string was treated as the executable name. Fixes #987 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Executed-By: beads/crew/dave Rig: beads Role: crew
This commit is contained in:
committed by
Steve Yegge
parent
4009fc6709
commit
279a224866
@@ -130,8 +130,10 @@ Examples:
|
||||
}
|
||||
_ = tmpFile.Close()
|
||||
|
||||
// Open the editor
|
||||
editorCmd := exec.Command(editor, tmpPath) //nolint:gosec // G204: editor from trusted $EDITOR/$VISUAL env or known defaults
|
||||
// Open the editor - parse command and args (handles "vim -w" or "zeditor --wait")
|
||||
editorParts := strings.Fields(editor)
|
||||
editorArgs := append(editorParts[1:], tmpPath)
|
||||
editorCmd := exec.Command(editorParts[0], editorArgs...) //nolint:gosec // G204: editor from trusted $EDITOR/$VISUAL env or known defaults
|
||||
editorCmd.Stdin = os.Stdin
|
||||
editorCmd.Stdout = os.Stdout
|
||||
editorCmd.Stderr = os.Stderr
|
||||
|
||||
Reference in New Issue
Block a user