Skip to content

docs(next): 記下 ydotool 0.1.x 語法未防呆與 Wayland 焦點偵測失效 - #163

Merged
yazelin merged 1 commit into
mainfrom
docs/ydotool-syntax-note
Aug 27, 2026
Merged

yazelin merged 1 commit into
mainfrom
docs/ydotool-syntax-note

Conversation

@yazelin

@yazelin yazelin commented Aug 27, 2026

Copy link
Copy Markdown
Owner

兩件在 Ubuntu 24.04 上會踩、在 26.04 上不會的坑,先寫進 NEXT.md,不改 code。

1. ydotool 語法未防呆(靜默失敗)
selection_linux.rs 寫死 1.x 的 keycode 語法 29:1 47:1 47:0 29:0。Ubuntu 24.04 內建的是 ydotool 0.1.8,只吃名字語法 ctrl+v;收到 keycode 語法會 exit 0 但送出錯的鍵(實測 42:1 42:0 送出 keycode 5 = 數字鍵 4),結果是焦點視窗被打進垃圾字元、log 卻回報「貼回完成」。

修法照抄 mori-ear 的 ydotool_wants_named_keys:跑一次 ydotool key --help,說明裡有「separated by plus」就是 0.1.x。

2. Wayland 下 terminal 偵測失效
capture_window_context() 靠 xdotool getactivewindow,Wayland 下必失敗 → process_name 空字串 → needs_shift_for_paste("") 回 false → 一律送 Ctrl+V,貼進終端機不會有反應。退路已經有:voice profile 的 USER-*.md frontmatter 寫 paste_shortcut: ctrl+shift+v。

兩件都在 mori-ear 上實測確認過(同一台 24.04 + GNOME 46 Wayland)。

🤖 Generated with Claude Code

兩件都不影響 26.04(ydotool 是 1.x、portal 熱鍵正常),但在 Ubuntu 24.04 上
會踩到,而且是靜默失敗:貼回打出垃圾字元、log 仍回報成功。修法與退路寫在
NEXT.md 裡。

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@yazelin
yazelin enabled auto-merge (squash) August 27, 2026 14:54
@yazelin
yazelin merged commit 08661f8 into main Aug 27, 2026
2 checks passed
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.

1 participant