claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] Claude Code TUI triggers KDE kcalc (Calculator) to launch when UI renders on KDE Plasma

Open gitshipdone opened this issue 4 months ago • 0 comments

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?

Environment

  • OS: EndeavourOS (Arch-based)
  • Kernel: 6.18.2-arch2-1
  • Desktop Environment: KDE Plasma 6.5.4 (KWin 6.5.4)
  • Display Server: Wayland
  • Claude Code Version: 2.0.76
  • Node.js Version: v25.2.1
  • Terminals Tested: Tabby 1.0.229, Konsole

Description

When Claude Code's TUI renders (specifically after approving the working directory prompt), the KDE application kcalc (KDE Calculator) automatically launches. This occurs consistently every time Claude Code initializes its interactive prompt.

The issue does not occur when Claude Code crashes before the UI renders (e.g., due to Node.js incompatibility), confirming the trigger is something in the TUI rendering phase.

Steps to Reproduce

  1. Have kcalc installed on KDE Plasma
  2. Open a terminal (tested with both Tabby and Konsole)
  3. Run claude
  4. Accept the working directory prompt (click "Yes" or approve)
  5. Result: kcalc window opens immediately when Claude Code's prompt appears

Investigation & Diagnostics Performed

  1. Verified it's not terminal-specific:
  • Issue occurs in both Tabby (Electron/xterm.js based) and Konsole (native KDE terminal)
  • Issue does NOT occur when Claude Code crashes before UI rendering
  1. Checked and modified KDE global shortcuts:
  • Removed kcalc from ~/.config/kglobalshortcutsrc
  • Removed X-KDE-Shortcuts=Calculator from /usr/share/applications/org.kde.kcalc.desktop
  • Deleted the kcalc shortcut group entirely from kglobalshortcutsrc
  • Restarted kglobalacceld service
  • Rebooted system
  • Result: kcalc still launches
  1. Checked system-level kglobalaccel files:
  • Found /usr/share/kglobalaccel/org.kde.kcalc.desktop exists
  • Verified X-KDE-Shortcuts= is empty in this file
  1. Monitored DBus for kglobalaccel signals: dbus-monitor --session "interface='org.kde.kglobalaccel'"
  • Result: No kglobalaccel signals were captured when kcalc launched, suggesting the trigger bypasses the normal KDE shortcut system
  1. Checked for other shortcut mechanisms:
  • Verified no xbindkeys configuration
  • Checked kded modules (plasma-session-shortcuts, etc.)
  • Searched for calculator-related entries in all config files

Hypothesis

Claude Code's TUI initialization sends terminal escape sequences (possibly related to synchronized output mode ?2026h or similar) that KDE Plasma is misinterpreting as the XF86Calculator media key or triggering kcalc through an alternative mechanism that bypasses kglobalaccel.

The fact that:

  1. It happens across multiple terminal emulators
  2. It happens specifically when the TUI renders (not on command execution)
  3. DBus monitor shows no kglobalaccel activity

...suggests the escape sequence is being interpreted at a lower level in the KDE/Qt input stack or through a non-standard activation path.

Workaround (not ideal):

Uninstalling kcalc resolves the symptom: sudo pacman -R kcalc

Additional Notes

  • This appears to be a KDE Plasma-specific issue
  • The behavior started occurring without any user configuration changes
  • Other KDE media key applications may potentially be affected by similar escape sequences

What Should Happen?

Running claude should open claude and not other applications.

Error Messages/Logs


Steps to Reproduce

run claude in terminal - accept dir request - kcalc pops up

Claude Model

Not sure / Multiple models

Is this a regression?

Yes, this worked in a previous version

Last Working Version

2.0.75 (maybe?)

Claude Code Version

2.0.76

Platform

Anthropic API

Operating System

Other Linux

Terminal/Shell

Other

Additional Information

No response

gitshipdone avatar Dec 31 '25 16:12 gitshipdone