Documentation
¶
Overview ¶
Package editor builds the *exec.Cmd that launches the user's $EDITOR on a given file. It exists as its own package so the CLI (focus edit) and the TUI (e/enter keybind) share the same parsing of $EDITOR — including the multi-token form like "code -w" or "vim -u NONE" that exec.Command can't handle directly.
Index ¶
Constants ¶
const DefaultEditor = "vi"
DefaultEditor is the fallback when $EDITOR is unset.
Variables ¶
This section is empty.
Functions ¶
func Command ¶
Command parses $EDITOR (falling back to DefaultEditor when unset) and returns an *exec.Cmd that runs it on path. $EDITOR is split on whitespace so values like "code -w" are interpreted as binary + args; this matches git's GIT_EDITOR semantics. Use Command.Stdin / Stdout / Stderr to wire I/O before calling Run().
Returns an error if $EDITOR is set but contains only whitespace.
Types ¶
This section is empty.