Feature Request: Text Selection with Keyboard in Chat Input [Shift + (arrow key)]

Resolved 💬 3 comments Opened Feb 5, 2026 by coreyt Closed Feb 9, 2026

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

Summary

Add keyboard-based text selection (Shift + arrow keys) and standard cut/paste operations (Ctrl+X, Ctrl+V) to the chat input area.

Problem Statement

When typing a prompt, I sometimes think of a higher-priority question I need to ask first. Currently, the workflow to temporarily save my in-progress prompt is cumbersome:

Current workflow:

  1. Use mouse to click and drag to select text
  2. Right-click to copy to clipboard
  3. Manually delete all selected text (Backspace/Delete)
  4. Type new urgent question
  5. Wait for response
  6. Paste original prompt back

This breaks flow and requires switching between keyboard and mouse repeatedly.

The Muscle Memory Problem

While Claude Code has Ctrl+S to stash the entire prompt, users instinctively reach for Shift + arrows due to decades of muscle memory from:

  • Every text editor (VS Code, Sublime, Notepad++, etc.)
  • Web browsers
  • IDEs
  • Office applications
  • Even most modern CLI tools

When that familiar keystroke doesn't work, it creates friction. Users find themselves:

  • Repeatedly trying Shift+arrow and being confused when nothing happens
  • Breaking concentration to remember "oh right, I need to use the mouse here"
  • Or learning an entirely new paradigm (Vim mode) just for text selection

The Ctrl+S stash feature is helpful for saving entire prompts, but it doesn't address the fundamental expectation: Shift should select text.

Proposed Solution

Proposed Solution

Add standard text selection keybindings to the chat input area:

Text Selection

  • Shift + Left/Right Arrow - Select text character-by-character
  • Shift + Up/Down Arrow - Select text line-by-line (for multi-line input)
  • Ctrl + Shift + Left/Right - Select word-by-word (optional enhancement)
  • Ctrl + A - Select all text (if not already bound)

Cut/Copy/Paste

  • Ctrl + X - Cut selected text to clipboard
  • Ctrl + C - Copy selected text to clipboard (while in selection mode)
  • Ctrl + V - Paste from clipboard
Note: Ctrl+C is currently bound to interrupt/exit. The selection-mode Ctrl+C would only apply when text is actively selected, maintaining the existing interrupt behavior when no selection exists.

Desired Workflow

  1. Type initial prompt: "Can you help me refactor the authentication module..."
  2. Think of urgent question
  3. Shift + Ctrl + A to select all text
  4. Ctrl + X to cut text
  5. Type urgent question: "What files handle user sessions?"
  6. Submit and get answer
  7. Ctrl + V to paste original prompt back
  8. Continue editing original prompt

Prior Art

Text selection with Shift + arrows is standard in most CLI tools:

  • Bash/Zsh readline - Supports selection in some configurations
  • Fish shell - Has visual selection mode
  • Helix editor - Uses selection-first editing model
  • VS Code terminal - Supports Shift + arrow selection
  • Windows Terminal - Supports Shift + arrow selection
  • Most GUI text inputs - Universal pattern users expect

Benefits

  1. Improved efficiency - Keyboard-only workflow is faster than mouse operations
  2. Better accessibility - Not all users can easily use mouse for precise text selection
  3. Consistency - Matches user expectations from other applications
  4. Flow preservation - No context-switching between keyboard and mouse

Alternative Solutions

Existing Workarounds (and why they're insufficient)

Vim Mode

  • Pro: Has visual mode (v), yank (y), paste (p)
  • Con: Requires learning Vim keybindings, modal editing mindset
  • Con: Uses d for delete/cut, not Ctrl+X - inconsistent with standard shortcuts
  • Verdict: Great for Vim users, but adds learning curve for others

External Editor (Ctrl+G)

  • Pro: Full text editing in system editor
  • Con: Opens separate window/buffer - breaks flow
  • Con: Overkill for quick text selection operations
  • Verdict: Useful for heavy editing, not for quick selection tasks

Prompt Stash (Ctrl+S)

  • Pro: Can save and restore the entire current prompt
  • Pro: Built-in, no setup required
  • Con: Only stores one prompt at a time (no queue/history)
  • Con: All-or-nothing - can't select and manipulate partial text
  • Con: Doesn't match the Shift+arrow muscle memory users already have
  • Verdict: Excellent for whole-prompt switching, but doesn't address the core UX gap of text selection

Terminal Selection

  • Pro: Some terminals support Shift + arrow
  • Con: Selects terminal output, not input buffer specifically
  • Con: Inconsistent behavior across terminals
  • Verdict: May work sometimes but unreliable

Motivation

Claude Code is an exceptional tool, and keyboard-based text selection would make the input experience even more polished and efficient. This is a quality-of-life improvement that would benefit both casual users (who expect standard text selection) and "almost power coders" (who want keyboard-only workflows without learning Vim).

Priority

Medium - Would be very helpful

Feature Category

Interactive mode (TUI)

Use Case Example

Use Cases

  1. Reordering thoughts - Move text around within a long prompt
  2. Temporary prompt switching - Set aside a complex prompt to ask a quick question
  3. Extracting snippets - Copy part of a prompt to use elsewhere
  4. Iterative refinement - Cut and rework sections of a prompt without retyping

Additional Context

Technical Considerations

The chat input area is built with Ink (React-based TUI framework). Text selection would require:

  1. Selection state management - Track selection start/end positions
  2. Visual feedback - Render selected text with inverse/highlighted colors
  3. Keybinding handlers - Add Shift+arrow and Ctrl+X/V handlers to the Chat context
  4. Clipboard integration - Already exists for Ctrl+V (image paste), extend for text
  5. Context-aware Ctrl+C - Only copy when text is selected, otherwise interrupt

Related Issues

Implementation Scope

Minimum Viable Feature

  • Shift + Left/Right arrow selection
  • Ctrl + X (cut), Ctrl + V (paste)
  • Visual indication of selected text

Nice-to-Have Enhancements

  • Shift + Up/Down for line-based selection
  • Ctrl + Shift + Left/Right for word-based selection
  • Ctrl + A for select all
  • Ctrl + C for copy (when text selected)
  • Mouse click-and-drag selection (if not already supported)

View original on GitHub ↗

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