fix(linux): bump xcap 0.0.4 → 0.9 — fixes UTF-8 crash on non-ASCII window titles#22
Open
leiha wants to merge 6 commits into
Open
fix(linux): bump xcap 0.0.4 → 0.9 — fixes UTF-8 crash on non-ASCII window titles#22leiha wants to merge 6 commits into
leiha wants to merge 6 commits into
Conversation
xcap 0.0.4 crashes with "invalid utf-8 sequence" on Linux/X11 when any window on the desktop has a title containing non-ASCII characters (accented characters, em-dash, etc). This is fixed in xcap upstream (nashaofu/xcap#266). Changes: - Bump xcap from 0.0.4 to 0.9 (Linux + macOS) - Bump image from 0.24.7 to 0.25 - Adapt xcap API: .title()/.app_name()/.is_minimized() now return XCapResult<T>, use .unwrap_or_default() for graceful degradation - Migrate image API: ImageOutputFormat::Jpeg(quality) replaced by JpegEncoder::new_with_quality() (image 0.25 breaking change) Tested: cargo check passes on Linux. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
image 0.25 makes codecs opt-in. Without explicit features, JPEG encoding fails at runtime with "encoder not enabled". Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
JPEG does not support alpha channel. The encoder fails when given Rgba8 data. Convert to Rgb8 before encoding. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Quand application_name est fourni, dérive /tmp/tauri-mcp-<app>.sock pour permettre coexistence multi-consumers (ori, iwe) sur l'écosystème Orun sans collision socket Unix. Cf D-015 iwe V0a (2026-04-29) — éprouvé runtime depuis 2026-04-29 via path-local consumers. Commit ratifie l'état déjà éprouvé pour pinning SHA cross-orisha (T-4 β D-028' sprint:9 iwe). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
executeJavaScript previously used new Function(`return (${code})`)() with a
new Function(code)() fallback, which returns undefined for multi-statement
snippets (e.g. 'const x=1; const y=2; x+y') — forcing callers to wrap
everything in an IIFE.
Replace with indirect eval via an alias (const indirectEval = eval). Indirect
eval runs in global scope (like new Function) but returns the completion value
of the last evaluated statement, so multi-statement code, declarations and bare
expressions all work. Level 1 wraps in parens for object-literal/expression
cases; Level 2 evaluates raw for statement lists. IIFEs keep working (already
expressions; the level-1 double-wrap is a harmless valid expression).
The ori/iwe apps now consume this fork via a pnpm `link:` path dependency (replacing the npm-registry `tauri-plugin-mcp@^0.1.0`, which shipped the old unfixed guest-js). pnpm does NOT run lifecycle scripts (prepare) for linked local packages, so the compiled dist-js must be present in the tree — otherwise a fresh clone of Orun would leave a dead link with no artifact to resolve. Un-gitignore dist-js/ and commit index.js/index.cjs/index.d.ts so the execute_js completion-value fix (22bbf41) reaches the apps' runtime without a build step. Rebuild with `pnpm build` after editing guest-js/.
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.
Summary
take_screenshotfails on Linux/X11 withinvalid utf-8 sequencewhen any window on the desktop has a non-ASCII title (e.g. French accents in browser tabs, em-dash in file manager).Root cause: xcap 0.0.4 uses
str::from_utf8()(strict) to parse X11 window titles. A single invalid byte crashes the entireWindow::all()enumeration. Fixed upstream in nashaofu/xcap#266.Changes
.title()/.app_name()/.is_minimized()now returnXCapResult<T>— use.unwrap_or_default()for graceful degradationImageOutputFormat::Jpeg(quality)→JpegEncoder::new_with_quality()(image 0.25 breaking change)Files changed
Cargo.toml— dep versionssrc/platform/unix.rs— xcap Result handlingsrc/platform/macos.rs— xcap Result handlingsrc/tools/take_screenshot.rs— image 0.25 JPEG encodingTest plan
cargo checkpasses on LinuxGenerated with Claude Code