matcha
matcha copied to clipboard
BUG: Potential panic on empty EDITOR environment variable
Describe the bug
In the external editor launch code (main.go:2376), strings.Fields(editor) is called on the EDITOR env var. If EDITOR is set to whitespace-only (e.g. EDITOR=" "), strings.Fields returns an empty slice. Accessing parts[0] then causes a panic (index out of range).
To reproduce
- Set
EDITOR=" " - Trigger external editor in composer
- Observe panic: index out of range
Expected behavior
Check len(parts) > 0 before accessing parts[0], return an error if empty.
This has had no activity for 30 days. It will be closed in 14 days unless updated. Comment or remove the stale label to keep it open.
Closing due to inactivity. Reopen if still relevant.