You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Ctrl+G external-editor failure can silently discard saved prompt text #5188
Using Ctrl+G from the normal composer to edit a long prompt in Vim can result in the saved prompt text being missing when control returns to Copilot CLI. This has occurred repeatedly but is not deterministic.
Environment
Copilot CLI: 1.0.98
OS: macOS arm64
Editor: Vim
Observed workflow
From the normal composer, press Ctrl+G.
Enter a long prompt in Vim.
Save and exit with :wq.
Return to the composer.
The newly entered text is missing. In an occurrence, the two temporary prompt files were no longer present afterward, and the session draft/history did not contain the text. No visible failure was reported.
Expected behavior
A successful editor save should populate the composer. If the editor exits unsuccessfully or the file cannot be read back, Copilot CLI should retain a recoverable copy and show an error with its recovery location rather than silently discarding the text.
Actual behavior
Prompt text was missing after returning from Vim, with no visible failure report and no remaining temporary copy available for recovery.
Investigation notes
A read-only local investigation indicates that the normal composer imports content only when the external editor operation succeeds, does not surface a nonzero editor exit as an error, and cleans up the temporary file. The incident exit code is unknown; this does not establish the exact cause.
An isolated Vim :wq test using harmless text and -i NONE succeeded with exit code 0, so the exact user trigger was not deterministically reproduced.
Workaround
Before :wq, save a separate permanent copy with :write <backup-path>.
Suggested diagnostics and test
Please consider recording sanitized editor exit status/signal, readback outcome, and the composer state update, and retaining a recovery copy until import is confirmed.
Hypothesis-only maintainer test idea (not executed): use an editor wrapper that writes the prompt file and then exits nonzero; verify that the composer reports the failure and retains the content for recovery.
Related: #5004 concerns Ctrl+G cancelling an ask_user question. This report concerns the normal composer and saved prompt text loss.
Activity