Skip to content

Conversation

@aibrahim-oai
Copy link
Collaborator

@aibrahim-oai aibrahim-oai commented Jan 11, 2026

Handle image paste on empty paste events.

  • Intent: make image paste work in terminals that emit empty paste events.
  • Approach: route paste events through an image-aware handler and read the clipboard when text is empty.
  • That's best effort to detect it. Some terminals don't send the empty signal.

@joshka-oai joshka-oai self-assigned this Jan 13, 2026
Copy link
Collaborator

@joshka-oai joshka-oai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add more context as doc comments around why we're making choices around this code. There's a lot of nuance that's not immediately obvious / discoverable here, and it would be good to capture these rather than having to dig for it in commit / PR history.

Do we have more details on which terminals act this way? Can we link it to any issues? What testing was done on this?

Comment on lines 1658 to 1660
self.add_to_history(history_cell::new_error_event(format!(
"Failed to paste image: {err}",
)));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make this message not be a dead end - i.e. tell the user what they can do next to succeed with their intended action. Something like: "Try saving the image on your clipboard somewhere and then copying the path in here" (let codex wordsmith some better suggestions on this).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@codex address both comments

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

Testing

  • just fmt
  • just fix -p codex-tui
  • cargo test -p codex-tui

View task →

@aibrahim-oai aibrahim-oai merged commit 18b7379 into main Jan 13, 2026
32 checks passed
@aibrahim-oai aibrahim-oai deleted the fix-tui-paste-image-cmdv branch January 13, 2026 07:40
@github-actions github-actions bot locked and limited conversation to collaborators Jan 13, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants