Skip to content

Handle \EOM escape sequence as newline for Konsole compatibility #2115

Closed as not planned

Description

@gwpl

(🤖 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:

Code Change (pseudo-code)

// In input handling
if (inputSequence === '\x1B\x4F\x4D') {  // \EOM
  insertNewline();  // Add newline to input buffer, do NOT send message
}

Benefits

  1. Works immediately for all Konsole users
  2. No terminal configuration required
  3. Doesn't break other applications (unlike terminal keybinding approach)
  4. 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

This would provide immediate relief for Konsole users while the longer-term Kitty protocol support (#1758) is being developed.

Activity

  1. self-assigned this
    on Jun 17, 2025
  2. wolffiex commented on Jun 17, 2025

    @wolffiex
    Collaborator

    sigh, terminal emulators are hard

  3. gwpl commented on Jun 18, 2025

    @gwpl
    Author

    @wolffiex Yes indeed, terminals are like many layers of the Matrix to go deeper! 🐇🕳️

    Speaking of terminal magic, I just opened #2266 about bringing some visual sorcery to Claude Code - terminal graphics protocols (Sixel, Kitty, iTerm2). Because sometimes ASCII art just isn't enough when you need to see that matplotlib graph or system diagram right in your terminal!

    Who knew that in 2025 we'd still be channeling the spirit of DEC VT340 terminals from the 80s? But hey, that's the beauty of terminals - they're both ancient scrolls and cutting-edge interfaces at the same time. ✨

  4. DBosley commented on Sep 14, 2025

    @DBosley

    Thank you @gwpl for that gist. This was bugging me a ton. Gotta love how ancient tech is still holding us back.

  5. github-actions commented on Dec 5, 2025

    @github-actions

    This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

  6. fanick1 commented on Dec 7, 2025

    @fanick1

    I am not sure if this is the right workaround, but what I tried was changing the key binding in the Konsole settings:
    Settings > Edit Current Profile... > Keyboard > Default(XFree 4) > Edit > filter for Return+Shift - change the \EOM to \n

    Image

    (it might have some side effects elsewhere - like shift+enter suddenly submitting commands in normal shell - but so far so good)

  7. github-actions commented on Jan 8, 2026

    @github-actions

    This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.

  8. github-actions commented on Jan 15, 2026

    @github-actions

    This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.

  9. locked as resolved and limited conversation to collaborators on Jan 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:tuibugSomething isn't workinghas reproHas detailed reproduction stepsplatform:linuxIssue specifically occurs on Linux

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions