[BUG] Ctrl+N/Ctrl+P no longer work for history navigation in Chat context since v2.1.18

Resolved 💬 3 comments Opened Jan 26, 2026 by daisuko Closed Jan 27, 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?

Since v2.1.18 (customizable keyboard shortcuts), Ctrl+N and Ctrl+P no longer work for history navigation in the Chat input area. These keys now move the cursor to beginning/end of line instead of navigating through command history. This is redundant since Ctrl+A and Ctrl+E already provide beginning/end of line navigation.

I tried configuring ~/.claude/keybindings.json:

{
  "$schema": "https://platform.claude.com/docs/schemas/claude-code/keybindings.json",
  "bindings": [
    {
      "context": "Global",
      "bindings": {
        "ctrl+p": "history:previous",
        "ctrl+n": "history:next"
      }
    }
  ]
}

This does not work. The history:previous and history:next actions do not seem to be available in the Chat or Global context.

Note: According to https://code.claude.com/docs/en/keybindings, "This feature is currently in preview and not available to all users", so the customization may not be enabled for my account.

What Should Happen?

Ctrl+P and Ctrl+N should navigate through command history (previous/next), as they did before v2.1.18 and as expected in standard readline/Emacs keybindings.

Error Messages/Logs

(None)

Steps to Reproduce

  1. Open Claude Code v2.1.19
  2. Type a prompt and submit it
  3. Type another prompt and submit it
  4. Press Ctrl+P to navigate to previous history
  5. Observe: cursor moves to beginning of line instead of showing previous command
  6. Press Ctrl+N
  7. Observe: cursor moves to end of line instead of showing next command

Claude Model

Sonnet (default)

Is this a regression?

Yes, this worked in a previous version

Last Working Version

Before v2.1.18

Claude Code Version

2.1.19

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

This is a critical issue for users with keyboards that lack arrow keys (e.g., HHKB).

One of Claude Code's strengths is that it runs in the terminal, respecting users' existing environment and muscle memory. Overriding standard readline keybindings breaks this philosophy. Users who chose terminal-based tools specifically because they can work without leaving the home row are now forced to use function keys or arrow keys, defeating the purpose of using a terminal tool.

Additionally, Ctrl+B (backward-char in readline) is also overridden by Claude Code for background task functionality. This is another frequently used keybinding that should be configurable to restore readline behavior.

Related issues:

  • #18054 (Ctrl+B passthrough for readline)
  • #2088 (Readline yank functionality)
  • #796 (Readline-compatible keybinding configuration)

Suggested Fix:

  1. Allow history:previous and history:next actions to be bound in the Chat context
  2. Or restore readline passthrough for Ctrl+N/Ctrl+P when not explicitly overridden
  3. Or add a setting to preserve terminal/readline keybindings

View original on GitHub ↗

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