Skip to content

Conversation

@ccross2
Copy link

@ccross2 ccross2 commented Feb 1, 2026

Summary

Fixes clipboard pasting on Wayland compositors (especially Unity) where wtype fails with "Compositor does not support the virtual keyboard protocol".

Changes

  1. ydotool 0.1.x compatibility: Use key name syntax (ctrl+v) instead of scan codes (29:1 47:1 47:0 29:0). The key name syntax works on both ydotool 0.1.x (Ubuntu packages) and 1.x versions.

  2. Prioritize ydotool on Wayland: When no target window ID is available, prefer ydotool over xdotool. xdotool reports success but can't reliably paste without window targeting on Wayland.

  3. Improved terminal detection: Add fallbacks for detecting terminal emulators on Wayland where window class is unavailable:

    • Check window title for terminal patterns
    • Check process name of the window (most reliable)

    This ensures terminals receive Ctrl+Shift+V instead of Ctrl+V.

Problem

On Wayland with Unity compositor:

  • wtype fails: "Compositor does not support the virtual keyboard protocol"
  • xdotool reports success but doesn't actually paste when targetWindowId is null
  • Terminal detection fails because xdotoolWindowClass is null on Wayland
  • ydotool 0.1.x (Ubuntu) uses different syntax than 1.x

Testing

Tested on Ubuntu 24.04 with:

  • Unity/Wayland compositor
  • wezterm terminal
  • ydotool 0.1.8 (Ubuntu package)

Test plan

  • Test paste in regular apps on Wayland
  • Test paste in terminal emulators on Wayland
  • Test with ydotool 0.1.x (Ubuntu)
  • Test with ydotool 1.x (if available)
  • Verify X11 behavior is unchanged

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.5 [email protected]

…ection

Fixes clipboard pasting on Wayland compositors (especially Unity) where
wtype fails with "Compositor does not support the virtual keyboard protocol".

Changes:

1. **ydotool 0.1.x compatibility**: Use key name syntax ("ctrl+v") instead
   of scan codes ("29:1 47:1 47:0 29:0"). The key name syntax works on
   both ydotool 0.1.x (Ubuntu packages) and 1.x versions.

2. **Prioritize ydotool on Wayland**: When no target window ID is available,
   prefer ydotool over xdotool. xdotool reports success but can't reliably
   paste without window targeting on Wayland.

3. **Improved terminal detection**: Add fallbacks for detecting terminal
   emulators on Wayland where window class is unavailable:
   - Check window title for terminal patterns
   - Check process name of the window (most reliable)

   This ensures terminals receive Ctrl+Shift+V instead of Ctrl+V.

Tested on Ubuntu 24.04 with Unity/Wayland compositor and wezterm.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@gabrielste1n gabrielste1n self-requested a review February 12, 2026 02:04
@gabrielste1n
Copy link
Collaborator

@ccross2 thanks for this - addressed in #262 - would love for you to test it out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants