anthropics / anthropics/claude-code

[BUG] Home/End in multi-line prompt input jump to buffer start/end, not line start/end; Chat context has no line-navigation actions to rebind

Open
#94,909 0 comments 0 reactions 0 assignees View on GitHub
area:tui bug has repro keybindings platform:linux
Dominant language
Python
Stars
145k
Forks
23.1k
PR merge metrics
PR metrics pending

Description

### Preflight Checklist

- [x] I have searched existing issues and this hasn't been reported yet (#86450 covered the VS Code extension chat panel on macOS and was closed as inactive; #67287 was the Down-arrow-to-end-of-line regression; neither covers the terminal input editor's End/Home keys)
- [x] This is a single bug report
- [x] I am using the latest version of Claude Code (2.1.273)

### What's Wrong?

In the terminal (CLI) input editor, with a multi-line prompt being composed, pressing **End** moves the cursor to the end of the *entire input buffer* rather than the end of the current logical line. **Home** behaves the same way toward the start of the buffer. Every other editor and readline-style input on the system treats Home/End as line-scoped.

`Ctrl+E` / `Ctrl+A` do move to the end / start of the current logical line, as documented in the interactive-mode reference, so the line-scoped motions exist — they are just not what the Home/End keys map to.

I also could not remap the keys: the keybindings reference lists `home` / `end` as recognized keystrokes and binds them in the `Scroll`, `Select`, and text-selection contexts (`scroll:top`, `scroll:bottom`, `select:first`, `select:last`, `selection:extendLineStart`, `selection:extendLineEnd`), but the `Chat` context exposes no cursor-navigation actions (nothing like `chat:lineStart` / `chat:lineEnd`), so `~/.claude/keybindings.json` cannot fix it.

### Expected

Home/End move to the start/end of the current logical line in multi-line input (matching `Ctrl+A` / `Ctrl+E`), or at least the `Chat` context exposes line-start / line-end / buffer-start / buffer-end actions so the keys can be bound in `keybindings.json`.

### Steps to Reproduce

1. `claude` in a terminal (Linux, tmux; also reproduced from a macOS terminal over SSH).
2. Type a line, `Shift+Enter` (or `\` + Enter) for a second line, type more, then `Up` to move the cursor into the first line, and press `Home` or `End`.
3. The cursor lands at the start / end of the whole buffer instead of the current line.

### Environment

- Claude Code 2.1.273
- Linux (NixOS), bash, inside tmux; terminal reports `home` / `end` normally (nvim and bash line-scope them as expected)
- Not vim editor mode

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the terminal CLI input editor and compare the documented Ctrl+A/Ctrl+E behavior with the Home/End key handling. Review the Chat context and ~/.claude/keybindings.json reference; done means Home and End operate on the current logical line, or equivalent Chat actions can be rebound, with the reproduction steps no longer showing buffer-wide movement.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash
Domain
cli, developer-experience
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.