Skip to content

Commit ee9b054

Browse files
docs(ghostty): add "edit long prompts in your editor" tip (Ctrl+G + EDITOR)
How to fix a long prompt mid-line without arrow-keying: Ctrl+G opens it in $EDITOR. Includes setting EDITOR with the essential --wait/-w flag and a Sublime example (+ symlinking subl onto PATH). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 2994ae3 commit ee9b054

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

docs/environment/terminal-and-ghostty.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,22 @@ Copy any image to the clipboard, then press **Ctrl+V** in the Claude Code prompt
8686
| New split | **Cmd+D** |
8787
| Reload config | **Cmd+Shift+,** |
8888

89+
## Edit long prompts in your editor
90+
91+
Wrote a long, multi-line prompt and want to fix something in the middle? You can't click to reposition the cursor in a terminal prompt — but you don't have to arrow-key back like a robot either. Press **Ctrl+G** in the Claude Code prompt and the current text opens in your `$EDITOR`, with full mouse support, undo, and multi-line editing. Save and close the file, and the edited prompt returns to Claude.
92+
93+
Set your editor once in `~/.zshrc`. The **`--wait` / `-w`** flag is essential — it makes the editor block until you close the file, so Claude waits for you instead of thinking you're done immediately:
94+
95+
```bash
96+
export EDITOR="subl --wait" # Sublime Text
97+
# export EDITOR="code -w" # VS Code
98+
# export EDITOR="vim" # vim (already blocks)
99+
# export EDITOR="nano" # nano
100+
```
101+
102+
> [!TIP]
103+
> If `subl` (or `code`) isn't on your `PATH`, symlink its CLI into a directory that is — e.g. `ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" ~/.local/bin/subl`. Then open a new terminal (or `source ~/.zshrc`) and restart `claude` so it picks up `$EDITOR`.
104+
89105
## Next steps
90106

91107
- Run the [one-command setup](./bootstrap-setup.md) to install Ghostty and everything else in one go.

0 commit comments

Comments
 (0)