[BUG] Konsole steals focus during command execution on KDE Wayland, breaking popup/context menus system-wide
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?
When running Claude Code in Konsole on KDE Plasma (Wayland), Konsole aggressively
steals window focus every time a command executes. This causes popup menus, context
menus (right-click), and dropdown menus across ALL applications to immediately close
or lose focus — not just in the terminal, but system-wide. The desktop becomes
effectively unusable for any workflow that requires right-click context menus while
Claude Code is running.
This is not limited to Claude Code's own UI — it breaks KDE system menus, browser
context menus, file manager menus, and any application with popup/dropdown elements.
What Should Happen?
Konsole should not steal window focus when Claude Code executes commands. Popup menus
and context menus in other applications should remain functional while Claude Code is
running in a Konsole terminal.
Error Messages/Logs
No error messages. The symptom is purely behavioral — focus is silently stolen
from the active window whenever Konsole/Claude Code executes a command.
Steps to Reproduce
- Run KDE Plasma on Wayland (tested on Fedora with Qt 6.x)
- Open Konsole
- Launch Claude Code in Konsole
- While Claude Code is running or executing commands, right-click anywhere
on the desktop or in another application
- Observe that the context menu either fails to appear, immediately closes,
or loses focus
WORKAROUND/FIX:
Create a KDE window rule that sets focus stealing prevention to High for Konsole:
kwriteconfig6 --file kwinrulesrc --group 1 --key Description "Konsole No Focus Steal"
kwriteconfig6 --file kwinrulesrc --group 1 --key wmclass "konsole"
kwriteconfig6 --file kwinrulesrc --group 1 --key wmclassmatch 1
kwriteconfig6 --file kwinrulesrc --group 1 --key fsplevel 3
kwriteconfig6 --file kwinrulesrc --group 1 --key fsplevelrule 2
kwriteconfig6 --file kwinrulesrc --group 1 --key types 1
kwriteconfig6 --file kwinrulesrc --group General --key count 1
Then reload KWin:
qdbus6 org.kde.KWin /KWin reconfigure
Claude Model
None
Is this a regression?
I don't know
Last Working Version
v2.1.81
Claude Code Version
v2.1.81
Platform
Anthropic API
Operating System
Other Linux
Terminal/Shell
Other
Additional Information
Regression Unknown — this appears on fresh Fedora installs with current KDE Plasma on Wayland.
This likely affects ALL terminal-heavy applications running in Konsole on KDE
Wayland, not just Claude Code. However, Claude Code's rapid command execution
pattern makes the focus stealing constant and the system unusable. Related KDE
upstream bugs: bugs.kde.org #488060, #500294. The workaround above resolves the
issue completely.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗