Skip to content

Make prompt images deletable (without selection)#399

Closed
cxa wants to merge 1 commit intoxenodium:mainfrom
cxa:image-delete
Closed

Make prompt images deletable (without selection)#399
cxa wants to merge 1 commit intoxenodium:mainfrom
cxa:image-delete

Conversation

@cxa
Copy link

@cxa cxa commented Mar 12, 2026

Problem:

  • In agent-shell-mode, when the prompt contains an inline image, C-d with point on the image and DEL with point just after the image do not remove it.

Fix:

  • Add explicit agent-shell-mode bindings for C-d, DEL, <backspace>, and <delete> so the expected delete keys are available in the mode.
  • Route image deletion through delete-field.
  • Mark only inline image attachments with a private field symbol: agent-shell--image-field.
  • Leave non-image file attachments unchanged.

Tests:

  • Added a test that inline image context is marked with the image field.
  • Added a test that non-image file context does not get that field.
  • Added a forward-delete test for deleting an inline image.
  • Added a backward-delete test for deleting an inline image.
  • Added a keybinding test for the delete keys in agent-shell-mode.

Checklist

  • I agree to communicate (PR description and comments) with the author myself (not AI-generated).
  • I've reviewed all code in PR myself and will vouch for its quality.
  • I've read and followed the Contributing guidelines.
  • I've added tests where applicable.

xenodium added a commit that referenced this pull request Mar 14, 2026
@xenodium
Copy link
Owner

Thank you for the PR!

I've submitted 92f99ad to make deletion more generic. Should work with any other binding users are used to and also cover both the shell and compose buffers. Can you give that a try and see if it works for your use case?

@cxa
Copy link
Author

cxa commented Mar 14, 2026

Works, thanks!!!

@cxa cxa closed this Mar 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants