Repository navigation
+edit-config fails when $VISUAL contains arguments #11897
Description
Discussed in #11895
Originally posted by xpe March 27, 2026
Issue Description
I expect that setting export VISUAL="zed --new" would work just fine with ghostty +edit-config but it does not.
(I might be wrong, but I feel like this was recently working in a previous version of Ghostty (tip).)
Expected Behavior
# .zshenv
export VISUAL="zed --new"Note to the above: IIRC, I think the long version of the flag was recently renamed from --new-window to --new. I checked with both --new and -n and the Ghostty error is the same (shown below).
% ghostty +edit-configI would expect the above to start the Zed editor in a fresh workspace.
% zed --version
Zed 0.229.0 – /Applications/Zed.app
% which zed
/usr/local/bin/zedNotes
-
I have confirmed this issue does not occur with
export VISUAL="zed" -
I have not yet tried to generalize this issue; e.g. to see if this is specific to Zed. I doubt it is Zed-specific. It is more likely related to how
$VISUALis handled by . -
IIRC, I've used this style of
$VISUALenvironment variable before (with an argument) with other programs that invoke$VISUAL, and it tends to work. That said, I'm not sure what is considered "standard". After asking and discussing with Claude Sonnet 4.6, it said "Whether [adding a CLI argument to the env variable] works depends entirely on how the calling program invokes $VISUAL, not on the export itself."
Actual Behavior
% ghostty +edit-config
Failed to execute the editor. Error code=error.FileNotFound.
This is usually due to the executable path not existing, invalid
permissions, or the shell environment not being set up
correctly.
Editor: zed --new
Path: /Users/username/Library/Application Support/com.mitchellh.ghostty/configReproduction Steps
export VISUAL="zed --new"ghostty +edit-config
Ghostty Logs
% sudo log stream --level debug --predicate 'subsystem=="com.mitchellh.ghostty"'
Password:
Filtering the log data using "subsystem == "com.mitchellh.ghostty""
Timestamp Thread Type Activity PID TTL
2026-03-27 09:49:29.465952-0400 0x2ff903 Info 0x0 61503 0 ghostty: [com.mitchellh.ghostty:default] ghostty version=1.3.2-main+efc0e4118
2026-03-27 09:49:29.466390-0400 0x2ff903 Info 0x0 61503 0 ghostty: [com.mitchellh.ghostty:default] ghostty build optimize=ReleaseFast
2026-03-27 09:49:29.466407-0400 0x2ff903 Info 0x0 61503 0 ghostty: [com.mitchellh.ghostty:default] runtime=.none
2026-03-27 09:49:29.466413-0400 0x2ff903 Info 0x0 61503 0 ghostty: [com.mitchellh.ghostty:default] font_backend=.coretext
2026-03-27 09:49:29.466418-0400 0x2ff903 Info 0x0 61503 0 ghostty: [com.mitchellh.ghostty:default] renderer=renderer.generic.Renderer(renderer.Metal)
2026-03-27 09:49:29.466424-0400 0x2ff903 Info 0x0 61503 0 ghostty: [com.mitchellh.ghostty:default] libxev default backend=kqueue
2026-03-27 09:49:29.466581-0400 0x2ff903 Info 0x0 61503 0 ghostty: [com.mitchellh.ghostty:os_locale] os_locale: setlocale from env result=en_US.UTF-8
2026-03-27 09:49:29.466689-0400 0x2ff903 Info 0x0 61503 0 ghostty: [com.mitchellh.ghostty:default] executing CLI action=.edit-config
2026-03-27 09:49:29.468043-0400 0x2ff906 Info 0x0 61503 0 ghostty: [com.mitchellh.ghostty:sentry] sentry: sentry envelope does not contain crash, discarding
2026-03-27 09:49:29.469751-0400 0x2ff903 Error 0x0 61503 0 ghostty: [com.mitchellh.ghostty:default] error reading optional config file, not loading err=error.FileIsEmpty path=/Users/username/Library/Application Support/com.mitchellh.ghostty/config
2026-03-27 09:49:29.469821-0400 0x2ff903 Info 0x0 61503 0 ghostty: [com.mitchellh.ghostty:config] config: default shell source=env value=/bin/zsh
Ghostty Version
Ghostty 1.3.2-main+efc0e4118
Version
- version: 1.3.2-main+efc0e4118
- channel: tip
Build Config
- Zig version : 0.15.2
- build mode : .ReleaseFast
- app runtime : .none
- font engine : .coretext
- renderer : renderer.generic.Renderer(renderer.Metal)
- libxev : kqueue
OS Version Information
macOS Tahoe 26.3.1 (a)
(Linux only) Display Server
None
(Linux only) Desktop Environment/Window Manager
No response
Minimal Ghostty Configuration
<<default / empty>>Additional Relevant Configuration
% zed --version
Zed 0.229.0 – /Applications/Zed.appI acknowledge that:
- I have reviewed the FAQ and confirm that my issue is NOT among them.
- I have searched the Ghostty repository (both open and closed Discussions and Issues) and confirm this is not a duplicate of an existing issue or discussion.
- I have checked the "Preview" tab on all text fields to ensure that everything looks right, and have wrapped all configuration and code in code blocks with a group of three backticks (
```) on separate lines.
Activity
cli: +edit-config works properly when editor command contains arguments
cli: +edit-config works properly when editor command contains argumen…