Handle \EOM escape sequence as newline for Konsole compatibility
(🤖 Crafted in digital dialogue co-authored w/ AI, pondering why terminals still haunt us with 1978 ghosts...)
Problem
In KDE Konsole with "Default (XFree 4)" keyboard layout, pressing Shift+Enter sends \EOM (ESC O M, hex: 0x1B 0x4F 0x4D) instead of a newline. This is the VT100 escape sequence for numeric keypad Enter.
Current Behavior
- Press Shift+Enter in claude directly in Konsole (expecting to add a newline without sending the message)
- "OM" appears in the input field
- No newline is created
- User cannot create multi-line input
Expected Behavior
- Press Shift+Enter
- A newline is inserted for multi-line entry without sending the message
- User can continue typing on the next line
- Enter (without Shift) sends the complete multi-line message
Note
This issue is not visible when using tmux inside Konsole, as tmux intercepts and normalizes escape sequences, translating \EOM appropriately instead of displaying "OM".
Root Cause
Konsole's default keytab maps Return+Shift : "\EOM" due to legacy VT100 compatibility. This made sense when terminals had physical numeric keypads (1970s-1980s), but modern users expect Shift+Enter to insert newlines for multiline input.
Proposed Solution
Claude Code should interpret \EOM as a newline insertion (NOT message submission). This would:
- Fix the issue for all Konsole users without requiring terminal reconfiguration
- Maintain compatibility (no app legitimately expects
\EOMfrom Shift+Enter in 2025) - Avoid the pitfalls of terminal-specific keybinding modifications (see #614)
- Allow multi-line input composition in Konsole
Code Change (pseudo-code)
// In input handling
if (inputSequence === '\x1B\x4F\x4D') { // \EOM
insertNewline(); // Add newline to input buffer, do NOT send message
}
Benefits
- Works immediately for all Konsole users
- No terminal configuration required
- Doesn't break other applications (unlike terminal keybinding approach)
- Simple, focused fix for a specific escape sequence issue
Alternative Workaround
Users can manually fix by modifying Konsole's keytab (script available: https://gist.github.com/gwpl/e2f5a4ade2a3ef02a811b761c8993bc4), but this requires technical knowledge and per-user configuration.
Environment
- Terminal: KDE Konsole
- Keyboard Layout: Default (XFree 4)
- OS: Linux (KDE)
- Claude Code version: [affected in current version]
Related Issues
- #1758 (general Shift+Enter support)
- #614 (terminal keybinding conflicts)
This would provide immediate relief for Konsole users while the longer-term Kitty protocol support (#1758) is being developed.
This issue has 7 comments on GitHub. Read the full discussion on GitHub ↗