claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

Paste into prompt fails when running Claude Code over SSH (Windows console → remote Linux)

Open adleruva-hub opened this issue 4 months ago • 4 comments

Summary

When Claude Code runs over an SSH session (Windows client → remote Linux host), pasting text into the prompt input fails. The same clipboard content pastes fine into the surrounding shell (PowerShell) but not into the Claude Code TUI input box.

Environment

  • Claude Code version: 2.1.205 (latest at time of report)
  • Client: Windows 10/11, connecting via the built-in OpenSSH client launched from a legacy console (conhost / cmd.exe) window
  • Command used to connect: ssh user@remote-linux-host, then claude on the remote host
  • Server: Linux (Claude Code process runs on the remote host)

Steps to reproduce

  1. From a Windows cmd.exe/conhost window, ssh into a remote Linux host.
  2. Run claude on the remote host.
  3. Copy some plain text to the Windows clipboard (e.g. from Notepad).
  4. In the Claude Code prompt, try to paste with any of:
    • Ctrl+V
    • Ctrl+Shift+V
    • right mouse button (console QuickEdit paste)

Actual behavior

  • Ctrl+V / Ctrl+Shift+V → shows a message telling the user they are SSH'd and to use scp (the image-paste-over-SSH message), even though the clipboard contains plain text, not an image. Nothing is pasted.
  • Right mouse button → nothing happens at all (the TUI appears to capture mouse input, so the console's own right-click paste never fires).
  • The exact same copied text pastes normally into the surrounding PowerShell/cmd shell, confirming the OS clipboard and console paste are healthy — the failure is specific to the Claude Code input over SSH.

Expected behavior

Plain-text paste into the prompt should work over SSH (as it does locally), or at minimum text paste should not be routed into the image-paste "try scp" path.

Notes

  • No image is on the clipboard; this is text-only.
  • Bracketed-paste degradation over the SSH + Windows-console path is a likely culprit, and the "you're SSH'd, try scp" fallback appears to conflate image-paste failure with all paste failures.
  • This is a hard blocker for users who rely on pasting into the prompt over SSH.

adleruva-hub avatar Jul 09 '26 20:07 adleruva-hub

Closing for now — inactive for too long. Please open a new issue if this is still relevant.

github-actions[bot] avatar Sep 01 '26 22:09 github-actions[bot]

Fix: Ctrl+V paste fails in Claude Code CLI over SSH (Windows client → Linux server)

Symptom: When running Claude Code over an SSH session (Windows client connecting to a remote Linux host), pressing Ctrl+V to paste plain text into the prompt does nothing useful. Instead, you get:

No image found in clipboard. You're SSH'd; try scp?

This happens even when the clipboard contains plain text, not an image. The same copied text pastes fine into the surrounding shell — the issue is specific to Claude Code's TUI.

Root cause: Two local config settings on the remote host cause Claude Code to intercept Ctrl+V for image-paste handling instead of passing it through to normal terminal paste:

~/.claude/keybindings.json binds ctrl+v to chat:imagePaste ~/.claude/settings.json sets "tui": "fullscreen", which causes Claude Code to capture the paste keystroke before your terminal can handle it normally

Fix:

On the remote host, edit both files:

~/.claude/keybindings.json — set the ctrl+v binding to null:

json "ctrl+v": null

(previously: "ctrl+v": "chat:imagePaste")

~/.claude/settings.json — remove the fullscreen TUI setting:

json {}

(previously: {"tui": "fullscreen"})

Then fully quit and relaunch the claude CLI for the changes to take effect.

Result: The "No image found in clipboard" message disappears. Text paste now works via:

Ctrl+Shift+V Shift+Insert Right-click paste

Note: This doesn't force Windows to route Ctrl+V specifically to Claude Code over SSH (that's a terminal-emulator-level binding, outside Claude Code's control) — but it removes Claude Code's own incorrect interception, letting your terminal's normal paste shortcuts work as expected

Image

rychy-vpsstorages avatar Sep 30 '26 09:09 rychy-vpsstorages

This issue was incorrectly closed by the github-actions bot, despite having reproduction steps and Claude version. This bot behavior is tracked in https://github.com/anthropics/claude-code/issues/87647. Consider upvoting that issue for visibilty, maybe the bot behavior gets fixed.

marcindulak avatar Sep 30 '26 13:09 marcindulak

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.

github-actions[bot] avatar Nov 26 '26 14:11 github-actions[bot]