Skip to content

Conversation

@dbpolito
Copy link
Contributor

@dbpolito dbpolito commented Jan 6, 2026

Very often when you change session and do cmd+v on an focused and empty prompt, the pasted image from clipboard, it breaks:

image

Now we should be handling properly:

image

@dbpolito dbpolito requested a review from adamdotdevin as a code owner January 6, 2026 21:25
@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

The following comment was made by an LLM, it may be inaccurate:

Based on the search results, I found several related PRs that might be duplicates or address similar paste/clipboard/image functionality:

Potential Related PRs:

  1. PR feat: auto-compress clipboard images to avoid API size limits #6455 - feat: auto-compress clipboard images to avoid API size limits

  2. PR fix: handle uppercase image extensions when pasting file paths #6005 - fix: handle uppercase image extensions when pasting file paths

  3. PR fix(tui): enable middle-click paste across TUI #6170 - fix(tui): enable middle-click paste across TUI

  4. PR fix: support reading furl (file URL) from macOS clipboard #6127 - fix: support reading furl (file URL) from macOS clipboard

  5. PR fix(clipboard): add OSC 52 fallback for SSH/tmux environments #7028 - fix(clipboard): add OSC 52 fallback for SSH/tmux environments

These PRs are related to clipboard and image handling, but none appear to be exact duplicates of PR #7130. However, PR #6455 (auto-compress clipboard images) and PR #6005 (handle image extensions) seem closest in scope to the paste image functionality being fixed.

}

const handlePaste = async (event: ClipboardEvent) => {
if (!isFocused()) return
Copy link
Contributor

Choose a reason for hiding this comment

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

why remove this? this was added because of conflicts between the terminal component and the prompt input, does removing it not cause any issues there?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the event is on the this div, the terminal is on a completely different component, maybe when this was added it was checking listening to document paste before?

i tested pasting on terminal and on prompt, seems to be working fine...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

and for some reason, adding back this makes the issue come back... so this is somehow acting up....

doing further debugging on this isFocused, it's very buggy right now, sometimes even focusing the input, typing, and pasting, this is still false... very weird

@dbpolito
Copy link
Contributor Author

dbpolito commented Jan 7, 2026

@adamdotdevin good catch, the fix ended up being a lot simpler... the real issue is we're focusing before registering the listener... so the actual fix is just that, the rest is cleanup...

lemme know if you want me to revert the cleanup and leave only the fix

@adamdotdevin adamdotdevin merged commit 2d5b9a5 into anomalyco:dev Jan 7, 2026
2 checks passed
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