jcode icon indicating copy to clipboard operation
jcode copied to clipboard

Ctrl+C draft clear (#1418): skipped in remote/disconnected mode, ignores image-only drafts, undo loses images

Open SiavZ opened this issue 2 months ago • 1 comments

Summary

#1418 added "first Ctrl+C clears the draft, the next one quits". Several gaps remain after it merged:

  1. Remote and disconnected modes don't clear. remote/key_handling.rs and the disconnected handler in remote.rs still call handle_quit_request() directly. In the normal remote TUI (the default when a server is running), Ctrl+C never clears the draft.
  2. 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.
  3. Quit takes three presses. The clear notice says "Press Ctrl+C again to quit", but clearing does not arm quit_pending.
  4. Stale composer state. Clearing skips reset_tab_completion() and sync_model_picker_preview_from_input().
  5. 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.

SiavZ avatar Sep 24 '26 09:09 SiavZ

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

1jehuang avatar Sep 27 '26 00:09 1jehuang