[BUG] @ file autocomplete Enter key submits message instead of accepting suggestion when image is pasted

Resolved 💬 2 comments Opened Feb 12, 2026 by cthomesmatt Closed Feb 15, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

When an image has been pasted into the input field, using the @ file path autocomplete and pressing Enter to accept a suggestion submits the entire message instead of completing the file path. Without an image present, Enter correctly accepts the autocomplete suggestion as expected.

What Should Happen?

Pressing Enter while the @ file autocomplete dropdown is active should always accept the selected suggestion, regardless of whether an image has been pasted into the input.

Error Messages/Logs

Steps to Reproduce

  1. Start a Claude Code session
  2. Paste an image into the input (e.g., screenshot via Ctrl+V)
  3. Type @ followed by the beginning of a file name
  4. Observe the autocomplete dropdown appears with file suggestions
  5. Press Enter to accept a suggestion
  6. The message is submitted instead of the file path being completed

Without image (works correctly):

  1. Type @ followed by the beginning of a file name
  2. Press Enter to accept a suggestion
  3. The file path is correctly inserted into the input

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

4.5

Claude Code Version

2.1.39 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

Related issues involving autocomplete and image paste conflicts:

#18106 — Ghost text submitted along with pasted image/file path
#20439 — Autocomplete suggestion submitted when pasting image + Enter (closed as duplicate of #18106)

This appears to be a separate manifestation of the same general problem area: the TUI's Enter key routing doesn't properly prioritize autocomplete acceptance over message submission when an image is present in the input buffer.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗