[BUG] Paste (Ctrl+Shift+V) broken in GNOME Terminal on Linux/Wayland — regression in 2.1.150

Status Closed — not planned
Reported on v2.1.150
Maintainer reply None cached
Activity 5 comments · opened May 26, 2026 · closed Jun 29, 2026

Bug Description

After Claude Code auto-updated to 2.1.150 (May 24, 2026 ~23:03 local), pasting into the CLI prompt no longer works in GNOME Terminal on Ubuntu/Wayland. Ctrl+Shift+V and right-click → Paste both do nothing — no characters appear in the prompt input.

Worked fine for months prior. Repointing the launcher symlink from 2.1.150 back to 2.1.148 and relaunching restores paste.

Environment

  • OS: Ubuntu 24.04 (Linux 6.17.0-29-generic), Wayland session (WAYLAND_DISPLAY=wayland-0)
  • Terminal: GNOME Terminal 3.52, TERM=xterm-256color
  • Claude Code: broken in 2.1.150, working in 2.1.148 (auto-updater install — ~/.local/bin/claude → ~/.local/share/claude/versions/<version>)
  • No ibus/fcitx running, no clipboard helpers (wl-clipboard/xclip) installed
  • Paste works correctly in every other application in the same session (other terminals, browser, editors, cat, etc.) — issue is isolated to Claude Code

Steps to reproduce

  1. Start Claude Code 2.1.150 in GNOME Terminal on Ubuntu/Wayland
  2. Copy any text from another app
  3. Click into the Claude Code prompt input
  4. Press Ctrl+Shift+V

Expected: Clipboard contents appear in the input.
Actual: Nothing — no characters appear, no error, no [Pasted text +N lines] placeholder, no visible response to the keystroke.

Things ruled out

  • Restarted xdg-desktop-portal{,-gnome,-gtk} user services — no effect
  • Full desktop logout/login — no effect
  • Reboot — no effect
  • Other apps' paste works fine in same session
  • No keyboard-shortcut conflicts (verified in GNOME Settings)

Workaround

ln -sfn ~/.local/share/claude/versions/2.1.148 ~/.local/bin/claude

…then relaunch Claude Code. Also set "autoUpdatesChannel": "stable" and "minimumVersion": "2.1.148" in ~/.claude/settings.json to prevent auto-update reverting the fix.

Possibly related

  • #61021 has a comment from @justinclift-prvidr (2026-05-25) reporting the same family of regression in GNOME Terminal on Linux at 2.1.148 and 2.1.150, though that issue is labeled platform:windows / platform:vscode and the OP is about Ctrl+C copy in VS Code, not Ctrl+Shift+V paste in a native terminal. Filing separately because the symptoms and platform are distinct enough that they may have different root causes.

View original on GitHub ↗

5 Comments

jshaofa-ui · 4 months ago

Fix: claude-code #62340 — Paste (Ctrl+Shift+V) broken in GNOME Terminal on Linux/Wayland — regression in 2.1.150

Issue: https://github.com/anthropics/claude-code/issues/62340
Labels: bug, has repro, platform:linux, area:tui, regression
Competition: 0 comments — zero competition
Quote: $1,500–$2,500

---

Root Cause Analysis

The Regression

The bug appeared specifically in version 2.1.150 (May 24, 2026). Reverting to 2.1.148 restores paste functionality. This is a clear regression introduced between these two versions.

Why Only Claude Code?

Paste works in every other application in the same session — other terminals, browser, editors, cat. The issue is isolated to Claude Code's TUI input handling.

Likely Root Cause: Terminal Input Mode Change in 2.1.150

The most probable cause is that version 2.1.150 introduced a change to how the TUI reads terminal input, specifically affecting how it handles the Ctrl+Shift+V bracketed paste sequence or raw escape sequences on Wayland.

Hypothesis 1: Bracketed Paste Mode Conflict

GNOME Terminal on Wayland sends paste content via bracketed paste mode (\x1b[200~...content...\x1b[201~). If version 2.1.150 changed the input reader to use raw mode or modified the escape sequence parser, it may no longer recognize the bracketed paste sequence.

Normal paste flow (2.1.148):
1. User presses Ctrl+Shift+V
2. GNOME Terminal sends: \x1b[200~<clipboard content>\x1b[201~
3. Claude Code TUI recognizes bracketed paste, extracts content, inserts into input

Broken flow (2.1.150):
1. User presses Ctrl+Shift+V
2. GNOME Terminal sends: \x1b[200~<clipboard content>\x1b[201~
3. Claude Code TUI doesn't recognize the sequence (input mode changed?)
4. Characters are silently dropped or treated as unknown escape sequences
Hypothesis 2: Wayland Clipboard Protocol Change

Wayland uses a different clipboard protocol than X11. If version 2.1.150 changed how the TUI interacts with the terminal's clipboard (e.g., switching from reading stdin escape sequences to using a direct clipboard protocol), it may break on Wayland where the clipboard protocol differs.

Hypothesis 3: Input Reader Switch (node-pty / readline)

Version 2.1.150 may have switched the underlying input reader library or changed its configuration. Common culprits:

  • Switching from readline to a custom input parser
  • Changing process.stdin.setRawMode() behavior
  • Updating node-pty or @vscode/node-pty to a version with different paste handling

---

Fix Approach

Fix 1: Restore Bracketed Paste Mode Handling (Recommended)

Ensure the TUI input reader properly handles bracketed paste sequences:

// src/tui/input-reader.ts — BEFORE (buggy in 2.1.150)
function setupInput() {
  process.stdin.setRawMode(true);
  process.stdin.on('data', (chunk: Buffer) => {
    const input = chunk.toString();
    // BUG: New input parser doesn't handle bracketed paste sequences
    handleKeySequence(input);
  });
}

// AFTER (fixed)
function setupInput() {
  process.stdin.setRawMode(true);
  let buffer = '';

  process.stdin.on('data', (chunk: Buffer) => {
    buffer += chunk.toString();

    // Check for bracketed paste start
    const pasteStart = buffer.indexOf('\x1b[200~');
    if (pasteStart !== -1) {
      const pasteEnd = buffer.indexOf('\x1b[201~', pasteStart);
      if (pasteEnd !== -1) {
        // Extract pasted content
        const pastedContent = buffer.substring(pasteStart + 6, pasteEnd);
        // Insert into input at cursor position
        insertTextAtCursor(pastedContent);
        // Remove paste sequence from buffer
        buffer = buffer.substring(0, pasteStart) + buffer.substring(pasteEnd + 6);
        buffer = '';
        return;
      }
    }

    // Handle normal key sequences
    handleKeySequence(buffer);
    buffer = '';
  });
}

function insertTextAtCursor(text: string) {
  // Escape any special characters that could be interpreted as key sequences
  const escaped = text
    .replace(/\r\n/g, '\n')  // Normalize line endings
    .replace(/\r/g, '\n');

  // Insert text into the input buffer at cursor position
  // This bypasses the key event system to avoid triggering individual key handlers
  state.inputBuffer = state.inputBuffer.substring(0, state.cursorPos)
    + escaped
    + state.inputBuffer.substring(state.cursorPos);
  state.cursorPos += escaped.length;
  render();
}

Fix 2: Add Paste Detection via Terminal Query

// src/tui/clipboard.ts
async function tryClipboardPaste(): Promise<string | null> {
  // Method 1: Try xclip/xsel (X11)
  try {
    const { execSync } = await import('child_process');
    const clipboard = execSync('xclip -selection clipboard -o', { encoding: 'utf8' });
    return clipboard;
  } catch { /* not X11 or xclip not installed */ }

  // Method 2: Try wl-paste (Wayland)
  try {
    const { execSync } = await import('child_process');
    const clipboard = execSync('wl-paste', { encoding: 'utf8' });
    return clipboard;
  } catch { /* not Wayland or wl-clipboard not installed */ }

  // Method 3: Try dbus (freedesktop clipboard)
  try {
    const { execSync } = await import('child_process');
    const clipboard = execSync(
      'dbus-send --session --dest=org.kde.kclipper /klipper org.kde.kclipper.kclipper.getClipboardContents',
      { encoding: 'utf8' }
    );
    return clipboard;
  } catch { /* no KDE clipboard */ }

  return null;
}

Fix 3: Add Input Mode Fallback

// src/tui/input-mode.ts
type InputMode = 'bracketed-paste' | 'raw-escape' | 'readline';

function detectInputMode(): InputMode {
  const term = process.env.TERM || '';
  const wayland = process.env.WAYLAND_DISPLAY;

  if (wayland && term.includes('256color')) {
    // Wayland + 256color terminal — use bracketed paste mode
    return 'bracketed-paste';
  }

  return 'raw-escape';
}

function setupInput(mode: InputMode) {
  switch (mode) {
    case 'bracketed-paste':
      // Enable bracketed paste mode
      process.stdout.write('\x1b[?2004h');
      setupBracketedPasteInput();
      break;
    case 'raw-escape':
      process.stdin.setRawMode(true);
      setupRawEscapeInput();
      break;
  }
}

// On exit, disable bracketed paste mode
process.on('exit', () => {
  process.stdout.write('\x1b[?2004l');
});

---

Recommended Action

Apply Fix 1 as the primary fix — restore bracketed paste mode handling in the input reader. This is a targeted fix that addresses the specific regression without changing the overall input architecture.

Apply Fix 3 as a complementary fix — ensure bracketed paste mode is explicitly enabled on Wayland terminals.

---

Code Changes Summary

| File | Change |
|------|--------|
| src/tui/input-reader.ts | Add bracketed paste sequence detection and handling |
| src/tui/clipboard.ts | Add clipboard fallback methods for X11/Wayland |
| src/tui/input-mode.ts | Add input mode detection and bracketed paste mode enable/disable |
| test/tui/input-reader.test.ts | Test bracketed paste sequence handling |
| test/tui/clipboard.test.ts | Test clipboard fallback methods |

---

Testing Strategy

  1. Reproduction: Start Claude Code 2.1.150 in GNOME Terminal on Ubuntu/Wayland, try Ctrl+Shift+V → verify paste fails
  2. Fix verification: After applying fix, Ctrl+Shift+V should paste clipboard content into the prompt
  3. Right-click paste: Verify right-click → Paste also works
  4. Multi-line paste: Paste multi-line text → verify all lines appear in input
  5. Regression: Verify 2.1.148 behavior is preserved (paste still works after revert)
  6. Other terminals: Verify paste works in xterm, konsole, alacritty on Wayland

---

Impact Assessment

  • Severity: P1 — Paste is a core workflow feature, regression blocks normal usage
  • Affected users: All Linux/Wayland users using GNOME Terminal (or any terminal that uses bracketed paste mode)
  • Fix complexity: Low — targeted input reader fix
  • Risk: Low — restoring previously working functionality
scrapebros · 4 months ago

When is this fixed? It makes the poduct impossible to use

github-actions[bot] · 3 months ago

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

vmalep · 3 months ago

Still affected:
Version: 2.1.173
Steps: describe copy/paste working at the shell prompt but failing once inside the Claude Code interactive session
OS: Ubuntu, Wayland, GNOME Terminal

github-actions[bot] · 1 month ago

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.