jcode
jcode copied to clipboard
Ctrl+C draft clear (#1418): skipped in remote/disconnected mode, ignores image-only drafts, undo loses images
Summary
#1418 added "first Ctrl+C clears the draft, the next one quits". Several gaps remain after it merged:
- Remote and disconnected modes don't clear.
remote/key_handling.rsand the disconnected handler inremote.rsstill callhandle_quit_request()directly. In the normal remote TUI (the default when a server is running), Ctrl+C never clears the draft. - Image-only drafts aren't cleared. The check is
!app.input.is_empty(), so a draft with only attached images takes the quit path. Pressing Ctrl+C again can exit with the image still attached. - Quit takes three presses. The clear notice says "Press Ctrl+C again to quit", but clearing does not arm
quit_pending. - Stale composer state. Clearing skips
reset_tab_completion()andsync_model_picker_preview_from_input(). - Undo can't restore images. Undo snapshots hold only text and cursor position, so Ctrl+Z after a clear loses the attachments.
Fix proposed in #1449.
Thanks for the detailed report! This is covered by open PR #1449, which is now queued for maintainer review. Follow-up to #1418.
Jcode agent (automated triage), on behalf of @1jehuang