openclaw - 💡(How to fix) Fix [Bug] TUI input breaks on German keyboard layout: duplicated printable characters and broken AltGr (@, €) [1 comments, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#48897Fetched 2026-04-08 00:51:18
View on GitHub
Comments
1
Participants
1
Timeline
1
Reactions
0
Author
Participants
Timeline (top)
commented ×1

In the TUI / gateway-client, keyboard input appears to break for a German keyboard layout:

  • some characters are duplicated when typed
  • AltGr-based printable characters are not entered correctly

This looks TUI/input-layer specific and does not reproduce outside the TUI.

Error Message

Examples seen in the TUI:

Root Cause

In the TUI / gateway-client, keyboard input appears to break for a German keyboard layout:

  • some characters are duplicated when typed
  • AltGr-based printable characters are not entered correctly

This looks TUI/input-layer specific and does not reproduce outside the TUI.

Code Example

\x1b[>7u

---

if (modifier & (MODIFIERS.alt | MODIFIERS.ctrl)) return undefined;
RAW_BUFFERClick to expand / collapse

Summary

In the TUI / gateway-client, keyboard input appears to break for a German keyboard layout:

  • some characters are duplicated when typed
  • AltGr-based printable characters are not entered correctly

This looks TUI/input-layer specific and does not reproduce outside the TUI.

Observed behavior

Examples seen in the TUI:

  • ? becomes ??
  • Ö becomes ÖÖ
  • Ü becomes ÜÜ
  • Ä becomes ÄÄ
  • ß becomes ßß
  • AltGr+Q does not produce @
  • AltGr+E does not produce

Expected behavior

  • printable characters should be inserted once
  • AltGr combinations should produce the expected printable characters
  • German keyboard layout input should work the same way it does outside the TUI

Scope / isolation

This appears to happen only in the TUI / gateway-client input path. No evidence so far that core config, gateway auth, or message routing is involved.

Possible cause

There may be an interaction between Kitty keyboard protocol handling and printable-character decoding for non-US layouts / AltGr.

Two suspicious areas:

  1. TUI enables Kitty keyboard protocol with:
\x1b[>7u

which includes alternate keys / event types.

  1. Printable CSI-u decoding appears to reject Alt/AltGr-modified printable keys:
if (modifier & (MODIFIERS.alt | MODIFIERS.ctrl)) return undefined;

That would plausibly explain why AltGr+Q (@) and AltGr+E () fail, and may also be related to duplicated printable input on a German layout.

Affected area

Likely in the TUI stack / dependency rather than higher-level app logic. Possible files:

  • @mariozechner/pi-tui terminal.js
  • @mariozechner/pi-tui keys.js

Environment

  • OpenClaw TUI / gateway-client
  • German keyboard layout
  • reproducible only inside the TUI

extent analysis

Fix Plan

To resolve the issue with keyboard input on German keyboard layouts in the TUI, we need to adjust the handling of alternate keys and printable-character decoding.

Step-by-Step Solution

  1. Modify the Kitty keyboard protocol handling: Update the Kitty keyboard protocol enable sequence to exclude alternate keys.
  2. Update printable CSI-u decoding: Modify the decoding logic to handle AltGr-modified printable keys correctly.

Code Changes

// Update Kitty keyboard protocol enable sequence
// Before: \x1b[>7u
// After: \x1b[>4u (disable alternate keys)

// Update printable CSI-u decoding
// Before:
// if (modifier & (MODIFIERS.alt | MODIFIERS.ctrl)) return undefined;
// After:
if (modifier & MODIFIERS.ctrl) return undefined;
// Allow AltGr-modified printable keys

Example Use Case

After applying the changes, test the input with a German keyboard layout:

  • Type ?, Ö, Ü, Ä, ß to verify that characters are not duplicated.
  • Press AltGr+Q to produce @ and AltGr+E to produce .

Verification

Verify that the changes fix the issue by testing the input with a German keyboard layout and checking that:

  • Printable characters are inserted once.
  • AltGr combinations produce the expected printable characters.

Extra Tips

  • Ensure that the updated code is properly tested and reviewed before deploying to production.
  • Consider adding additional logging or debugging statements to help identify any future issues with keyboard input handling.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

  • printable characters should be inserted once
  • AltGr combinations should produce the expected printable characters
  • German keyboard layout input should work the same way it does outside the TUI

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING