[Bug] Ctrl+G external editor takes several seconds to open on Windows (nvim itself starts in under 1s)
Summary
On Windows, pressing Ctrl+G to open the prompt in an external editor (nvim) takes a few seconds before the editor appears. The same nvim, with the same config and the same kind of temp file, starts in well under a second when launched directly. The delay appears to be in how Claude Code launches the editor, not in the editor.
Follow-up to Feedback ID 492f1a25-7a30-43bc-bd57-d36b85675445, which was submitted without a real description.
Environment
- Claude Code 2.1.287, native Windows (win32), Windows 11 Pro 10.0.26200
- Terminal: Windows Terminal
- Editor: Neovim v0.12.5 at C:\Program Files\Neovim\bin\nvim.exe
- settings.json: "env": { "VISUAL": "nvim" } (EDITOR is not set)
- Primary shell: PowerShell; Git Bash also installed
Steps to reproduce
- Set "env": { "VISUAL": "nvim" } in ~/.claude/settings.json.
- Start Claude Code in Windows Terminal and type some text in the prompt.
- Press Ctrl+G.
Expected
The editor opens about as fast as running nvim <tempfile> in the same terminal.
Actual
There is a delay of a few seconds between Ctrl+G and nvim appearing (judged by eye, not timed). Opening nvim on a temp .md file in a plain Windows Terminal tab, outside Claude Code, is noticeably faster.
Measurements
All runs are headless nvim opening the same temp .md file and quitting immediately, timed with Measure-Command from inside a Claude Code session.
Editor startup on its own:
| Run | Wall time |
| --- | --- |
| nvim --clean | 129 ms |
| Full user config, launched directly | 340 to 780 ms across runs |
After startup, the config's VimEnter work finishes within about 115 ms and only 12 plugins load, so the editor config does not account for a multi-second delay.
Same nvim command launched through different shells:
| Launch route | Wall time |
| --- | --- |
| nvim.exe directly | 778 ms |
| cmd /c nvim | 788 ms |
| pwsh -NoProfile | 1,455 ms |
| pwsh with user profile | 2,085 ms |
| Windows PowerShell 5 with profile | 1,918 ms |
| Git Bash login shell (bash -lc) | 2,341 ms |
Suspected cause (not confirmed)
If Ctrl+G spawns the editor through PowerShell or a Git Bash login shell instead of executing it directly, the shell startup alone adds 0.7 to 1.6 seconds on this machine, which matches the observed delay. I have not confirmed which route Claude Code actually uses.
Request
- Launch the external editor directly (or via cmd.exe) on Windows, without a profile-loading or login shell in between.
- If a shell is required, use a non-login shell with no profile.