◉ANTIGRAVITY LABJP
Articles/Editor View
⟐ Editor View/2026-11-27Beginner

Writing long prompts in my editor with Ctrl+G, after code closed instantly and came back empty

Why the editor opened by Ctrl+G in Antigravity CLI can return an empty prompt, how to fix it with a wait flag, a tiny wrapper that keeps your drafts, and how writing in an editor changed the shape of my instructions.

Antigravity CLI51Ctrl+GEDITORPromptingVS Code6

It was a morning when I wanted the agent to revise the store descriptions for my wallpaper app across several languages at once. The instruction was going to be long, so I pressed Ctrl+G in the Antigravity CLI prompt box, planning to write it in my editor.

The editor window flashed open, and in the same instant the terminal handed me back an empty prompt box. I hadn't typed a word yet. When I finished writing in the editor and saved, nothing reached agy at all.

The culprit wasn't agy. It was one word I had put in EDITOR months earlier. Below is the fix, a small wrapper that stops drafts from disappearing, and what changed about how I write instructions once I moved them into an editor.

Where the editor behind Ctrl+G comes from

The official "Prompting and interaction" page describes Ctrl+G in four steps:

  1. Press Ctrl+G in an empty prompt box.
  2. The CLI launches your default text editor, set through /config or your $EDITOR environment variable.
  3. You write your multi-line instruction in a temporary buffer.
  4. When you save and exit, the CLI imports the buffer back into the prompt box.

Step four is the one that matters. agy treats "the editor process exited" as the signal to read the temporary file back. So if your editor command exits right away, agy reads a file that is still empty — and that's that.

You can check what agy will see with two lines:

# Show the values agy will inherit from this shell
echo "EDITOR=${EDITOR:-(unset)} VISUAL=${VISUAL:-(unset)}"
command -v code nvim vim nano

Mine printed EDITOR=code, a leftover I had forgotten about.

Why plain code comes back empty

VS Code's code command hands the file to an existing window and returns control to the shell immediately. The tab stays open, but as far as the shell is concerned, the command is done. To make it wait until you close the tab, you add --wait.

That was exactly my symptom. Terminal editors like vim or nano don't return until you quit them, so they never show this problem.

My first fix was export EDITOR="code --wait" in .zshrc. Ctrl+G worked again. The next day, though, a git commit showed me a second problem, which I'll get to below.

If you want to use the Antigravity IDE's own command instead, the same idea applies, but please check that version's --help for an equivalent of --wait before relying on it. I didn't check the first time, and I got the same empty prompt for my trouble.

A tiny wrapper that keeps your drafts

The second problem was that whatever I wrote through Ctrl+G was gone once I sent it. The longer the instruction, the more I wanted to look back the next day and see how I had phrased it. So I wrote a small script that waits for the editor to close and, if the buffer isn't empty, saves a dated copy.

#!/usr/bin/env bash
# ~/bin/agy-editor — for agy's Ctrl+G only. Waits for close, keeps a copy.
set -euo pipefail
 
buf="${@: -1}"                      # last argument is the temp file path
archive="$HOME/agy-prompts"
mkdir -p "$archive"
 
if command -v code >/dev/null 2>&1; then
  code --wait "$@"                  # do not return until the tab closes
else
  "${FALLBACK_EDITOR:-vim}" "$@"    # terminal editor when VS Code is absent
fi
 
if [ -s "$buf" ]; then
  cp "$buf" "$archive/$(date +%Y%m%d-%H%M%S).md"
else
  echo "agy-editor: draft is empty (closed without saving?)" >&2
fi

Then I tripped again. I set this wrapper globally with export EDITOR=..., and my git commit messages started piling up in ~/agy-prompts. EDITOR isn't agy's alone; git, crontab, and plenty of other tools read the same value.

So now I swap it in only when launching agy:

# ~/.zshrc — use the wrapper for agy only; git keeps its usual EDITOR
chmod +x "$HOME/bin/agy-editor" 2>/dev/null
alias agy='EDITOR="$HOME/bin/agy-editor" command agy'

command agy keeps the alias from calling itself. And pointing EDITOR at a single executable, rather than a string with arguments, means it doesn't matter how the calling tool splits the value. It took me two empty prompts to settle on this shape.

Keep editor settings scoped to the tool that needs them. Rewriting the shell-wide EDITOR turned out to be a bigger change than it looked, because it quietly changed other tools too.

How writing in an editor changed my instructions

After the fix, I wrote every long instruction through Ctrl+G for about a week. Reading back through ~/agy-prompts, I could see the instructions themselves had changed shape.

The biggest shift was headings. In the prompt box I could insert newlines with Shift+Enter, but I never felt like I could see the whole thing while writing. In the editor, I found myself starting from a skeleton like this:

## Goal
Update only the "What's new" paragraph of the store description in each language
 
## You may edit
- The "What's new" paragraph in metadata/*/description.txt
 
## Please leave alone
- The first two paragraphs (search terms already tuned)
- App name and keyword fields
 
## Done when
- You list the changed files and the diff line count per language at the end

The official "Prompting and instructions" page in the Learn section suggests turning broad requests into goals, constraints, and checks. My skeleton just follows that, but giving "Please leave alone" its own heading cut down my omissions far more than I expected. Back when I typed everything into the prompt box in one go, that was exactly the part I kept forgetting.

The other shift was rereading before sending. Glancing over the whole draft just before closing the editor, I'd catch contradictory instructions or a sentence with no clear subject. Short requests are a different story, though. Opening an editor for a one-liner felt heavy, so anything that fits in a line or two still goes straight into the prompt box.

Write in the editor, send after a reread. That's the whole rule. I split by length, and I don't think either tool needs to win outright.

Someone in the community also shared a setup that opens this buffer in Neovim as Markdown so headings get highlighted. If you'd rather not leave the terminal, that may feel more natural than a GUI editor.

Once instructions get long, the next question is how they divide work with rule files like AGENTS.md. I wrote about a shared rule file getting cut off partway in When the end of a shared AGENTS.md never reaches Antigravity.

One thing to try next

Run echo "$EDITOR" once and see whether it holds a command that returns immediately, like code or subl on its own. If it does, that's why your prompt comes back empty.

Then try swapping in a waiting editor only for agy, and keep a week of drafts. It was only when I reread my own pile of drafts, as an indie developer working mostly alone, that I noticed which parts I tend to leave out.

Once you can write instructions carefully, the heavier side becomes reading the diffs the agent sends back. I described how I rebuilt that part in the premium article the review routine I rebuilt after the 2.8.0 view limit. When both the writing side and the reading side are in order, handing off long requests feels a lot calmer.

Share

Thank You for Reading

Antigravity Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • ✦Copy-paste ready implementation code
  • ✦New advanced guides published daily
  • ✦$5/mo or $10 for lifetime access
View Membership →

If you found this article helpful, a small tip ($1.50) would mean a lot to us. Your support helps keep this site ad-free and covers server and hosting costs.

Related Articles

⟐ Editor View2026-11-29
Delete or Shrink? Comparing agy conversations clean, compact, and Manual Cleanup, and the Order I Settled On
A comparison of agy conversations clean (CLI 1.5.19), the new compact command (1.5.20), and deleting files by hand — judged by reversibility, how subagents and backups are handled, and the risk to conversations your scripts resume — plus a pre-flight script for safe cleanup.
⟐ Editor View2026-11-17
Antigravity Sign-In Never Comes Back in Zed over SSH — Log In on the Remote Machine First
When Antigravity (agy acp) stalls at 'Launching browser login flow...' in a remote Zed session, here is how to tell auth from startup failures, cache credentials with agy acp --login, find the logs, and what to try next.
⟐ Editor View2026-03-10
VS Code × Antigravity Migration Guide — Seamlessly Transition Your Dev Environment to an AI IDE
A complete guide to migrating from VS Code to Google Antigravity. Learn how to transfer settings, extensions, keybindings, and effectively use both editors together.