fix(linux): prefer dotool for reliable Wayland text input#1299
Open
aasmall wants to merge 1 commit intocjpais:mainfrom
Open
fix(linux): prefer dotool for reliable Wayland text input#1299aasmall wants to merge 1 commit intocjpais:mainfrom
aasmall wants to merge 1 commit intocjpais:mainfrom
Conversation
3 tasks
c3d1c46 to
6aced16
Compare
- Prefer dotoolc (daemon client, faster) when dotoold is running - Add configurable typing delay (0-50ms, default 2ms) - Sanitize text to prevent dotool stdin command injection - Poll-based child process timeout (scales with text length and delay) - Warn user when no native typing tools are available
6aced16 to
7ea5af0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before Submitting This PR
Human Written Description
wtype works unreliably on wayland, often dropping characters. dotool was much more reliable. this PR adds it as a selectable option as well as hardens its implementation.
Prior art and context
dotool support on Linux was already discussed and accepted. This PR builds on that foundation:
TypingToolenum and the Advanced > Experimental > Typing Tool dropdown. This PR builds directly on that infrastructure — the dropdown already exists; this PR makes the dotool path much more reliable when selected.Related Issues/Discussions
Relevant to several open bugs around unreliable text input on Linux/Wayland:
Changes
dotoolc(daemon client, zero startup cost) with graceful fallback to standalonedotoolwhen dotoold isn't runningstatuscodes would lose)max(delay_ms, 1)sodelay_ms=0still gets per-char headroom. Finaltry_wait()before declaring timeout prevents false positives when the child exits right at the deadline.typing_delay_mssetting (0–50ms, default 2ms) with UI slider in Advanced > Experimental, with translations across all 20 localestyping_delay_msvalues instead of silently falling backAuto-detection priority unchanged. On Wayland the order remains wtype → dotool → ydotool, matching upstream behavior. dotool was already in the priority list via PR #760 — this PR just makes it more capable when selected or when the auto path lands on it.
Files changed: clipboard.rs (main logic), settings.rs (new setting + tests), shortcut/mod.rs (command registration), lib.rs (command wiring), bindings.ts, settingsStore.ts, TypingDelay.tsx (new slider), AdvancedSettings.tsx, translation.json + 19 locale files
This PR is rebased directly on
upstream/mainand does not depend on any other open PR.Testing
All auto-triggered CI checks verified locally before marking ready:
cargo fmt --check,cargo test(9 clipboard tests pass, including the new timeout scaling test)bun run lint,bun run format:check(excluding upstream's pre-existing AGENTS.md prettier issue)bun run check:translations— all 20 languages have complete keysbun run test:playwright— passesScreenshots/Videos
AI Assistance
If AI was used: