Shift+Enter Doesn't Insert Newline in CLI (Non-intuitive Key Binding)

Resolved 💬 3 comments Opened Oct 10, 2025 by pialmmh Closed Oct 14, 2025

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?

Pressing Shift+Enter does not insert a newline in the Claude Code CLI input. Instead, it outputs "OM" character(s). Users must use Alt+Enter instead, which is non-intuitive and
inconsistent with other AI chat clients.

Steps to Reproduce

  1. Start Claude Code CLI
  2. Type some text in the input prompt
  3. Press Shift+Enter expecting a newline
  4. Observe: "OM" is inserted instead of a newline

Expected Behavior

Shift+Enter should insert a newline in the input, allowing multi-line messages without sending.

This is the standard behavior across all major AI chat clients:

  • ChatGPT web UI: Shift+Enter = newline
  • DeepSeek UI: Shift+Enter = newline
  • Claude web UI: Shift+Enter = newline
  • Most chat applications: Shift+Enter = newline

Actual Behavior

  • Shift+Enter: Inserts "OM" characters (unexpected)
  • Alt+Enter: Inserts newline (current workaround)
  • Enter: Sends message (expected)

Environment

  • OS: Linux (Ubuntu/Debian)
  • Claude Code CLI version: [latest as of 2025-10-10]
  • Terminal: [terminal emulator being used]
  • Shell: bash

Impact

User Experience Issue - Medium Priority

  • Non-intuitive key binding breaks muscle memory
  • Users coming from any other AI chat client expect Shift+Enter to work
  • "OM" insertion is confusing and disrupts typing flow
  • Requires learning non-standard key binding (Alt+Enter)

Root Cause Analysis

The terminal is likely capturing Shift+Enter and sending escape sequence codes that are being interpreted as "OM" characters. The key binding for newline insertion is mapped to
Alt+Enter instead of the industry-standard Shift+Enter.

Suggested Fix

  1. Map Shift+Enter to insert newline (primary fix)
  2. Keep Alt+Enter as alternative for users who prefer it
  3. Document both key bindings clearly

Comparison with Other Clients

| Client | Newline Key | Send Message |
|-----------------|-------------|--------------|
| ChatGPT | Shift+Enter | Enter |
| Claude Web | Shift+Enter | Enter |
| DeepSeek | Shift+Enter | Enter |
| Most chat apps | Shift+Enter | Enter |
| Claude Code CLI | Alt+Enter ❌ | Enter |

User Quote

"when I press shift+enter, I don't get a new line in cli, I have to press alt+enter, its not intuitive. all ai chat clients support shift+enter e.g. chatgpt, deepseek ui"

Additional Notes

The "OM" output when pressing Shift+Enter suggests the terminal escape sequence is being passed through without proper handling. This indicates the key binding system may need to
properly capture and handle Shift+Enter before it reaches the terminal layer.

Workaround

Use Alt+Enter to insert newlines. However, this is not intuitive and breaks user expectations from other AI tools.

---

What Should Happen?

Pressing Shift+Enter does not insert a newline in the Claude Code CLI input. Instead, it outputs "OM" character(s). Users must use Alt+Enter instead, which is non-intuitive and
inconsistent with other AI chat clients.

Steps to Reproduce

  1. Start Claude Code CLI
  2. Type some text in the input prompt
  3. Press Shift+Enter expecting a newline
  4. Observe: "OM" is inserted instead of a newline

Expected Behavior

Shift+Enter should insert a newline in the input, allowing multi-line messages without sending.

This is the standard behavior across all major AI chat clients:

  • ChatGPT web UI: Shift+Enter = newline
  • DeepSeek UI: Shift+Enter = newline
  • Claude web UI: Shift+Enter = newline
  • Most chat applications: Shift+Enter = newline

Actual Behavior

  • Shift+Enter: Inserts "OM" characters (unexpected)
  • Alt+Enter: Inserts newline (current workaround)
  • Enter: Sends message (expected)

Environment

  • OS: Linux (Ubuntu/Debian)
  • Claude Code CLI version: [latest as of 2025-10-10]
  • Terminal: [terminal emulator being used]
  • Shell: bash

Impact

User Experience Issue - Medium Priority

  • Non-intuitive key binding breaks muscle memory
  • Users coming from any other AI chat client expect Shift+Enter to work
  • "OM" insertion is confusing and disrupts typing flow
  • Requires learning non-standard key binding (Alt+Enter)

Root Cause Analysis

The terminal is likely capturing Shift+Enter and sending escape sequence codes that are being interpreted as "OM" characters. The key binding for newline insertion is mapped to
Alt+Enter instead of the industry-standard Shift+Enter.

Suggested Fix

  1. Map Shift+Enter to insert newline (primary fix)
  2. Keep Alt+Enter as alternative for users who prefer it
  3. Document both key bindings clearly

Comparison with Other Clients

| Client | Newline Key | Send Message |
|-----------------|-------------|--------------|
| ChatGPT | Shift+Enter | Enter |
| Claude Web | Shift+Enter | Enter |
| DeepSeek | Shift+Enter | Enter |
| Most chat apps | Shift+Enter | Enter |
| Claude Code CLI | Alt+Enter ❌ | Enter |

User Quote

"when I press shift+enter, I don't get a new line in cli, I have to press alt+enter, its not intuitive. all ai chat clients support shift+enter e.g. chatgpt, deepseek ui"

Additional Notes

The "OM" output when pressing Shift+Enter suggests the terminal escape sequence is being passed through without proper handling. This indicates the key binding system may need to
properly capture and handle Shift+Enter before it reaches the terminal layer.

Workaround

Use Alt+Enter to insert newlines. However, this is not intuitive and breaks user expectations from other AI tools.

---

Error Messages/Logs

Steps to Reproduce

Pressing Shift+Enter does not insert a newline in the Claude Code CLI input. Instead, it outputs "OM" character(s). Users must use Alt+Enter instead, which is non-intuitive and
inconsistent with other AI chat clients.

Steps to Reproduce

  1. Start Claude Code CLI
  2. Type some text in the input prompt
  3. Press Shift+Enter expecting a newline
  4. Observe: "OM" is inserted instead of a newline

Expected Behavior

Shift+Enter should insert a newline in the input, allowing multi-line messages without sending.

This is the standard behavior across all major AI chat clients:

  • ChatGPT web UI: Shift+Enter = newline
  • DeepSeek UI: Shift+Enter = newline
  • Claude web UI: Shift+Enter = newline
  • Most chat applications: Shift+Enter = newline

Actual Behavior

  • Shift+Enter: Inserts "OM" characters (unexpected)
  • Alt+Enter: Inserts newline (current workaround)
  • Enter: Sends message (expected)

Environment

  • OS: Linux (Ubuntu/Debian)
  • Claude Code CLI version: [latest as of 2025-10-10]
  • Terminal: [terminal emulator being used]
  • Shell: bash

Impact

User Experience Issue - Medium Priority

  • Non-intuitive key binding breaks muscle memory
  • Users coming from any other AI chat client expect Shift+Enter to work
  • "OM" insertion is confusing and disrupts typing flow
  • Requires learning non-standard key binding (Alt+Enter)

Root Cause Analysis

The terminal is likely capturing Shift+Enter and sending escape sequence codes that are being interpreted as "OM" characters. The key binding for newline insertion is mapped to
Alt+Enter instead of the industry-standard Shift+Enter.

Suggested Fix

  1. Map Shift+Enter to insert newline (primary fix)
  2. Keep Alt+Enter as alternative for users who prefer it
  3. Document both key bindings clearly

Comparison with Other Clients

| Client | Newline Key | Send Message |
|-----------------|-------------|--------------|
| ChatGPT | Shift+Enter | Enter |
| Claude Web | Shift+Enter | Enter |
| DeepSeek | Shift+Enter | Enter |
| Most chat apps | Shift+Enter | Enter |
| Claude Code CLI | Alt+Enter ❌ | Enter |

User Quote

"when I press shift+enter, I don't get a new line in cli, I have to press alt+enter, its not intuitive. all ai chat clients support shift+enter e.g. chatgpt, deepseek ui"

Additional Notes

The "OM" output when pressing Shift+Enter suggests the terminal escape sequence is being passed through without proper handling. This indicates the key binding system may need to
properly capture and handle Shift+Enter before it reaches the terminal layer.

Workaround

Use Alt+Enter to insert newlines. However, this is not intuitive and breaks user expectations from other AI tools.

---

Claude Model

None

Is this a regression?

No, this never worked

Last Working Version

_No response_

Claude Code Version

latest as of 11 oct 2025

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

Other

Additional Information

_No response_

View original on GitHub ↗

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