Repository navigation
fix(macos): opt out of Writing Tools to prevent Campo crash (#355) - #406
Merged
Merged
Conversation
On macOS 15.1+ (Sequoia / Tahoe 26+), AppKit's CampoLightweightUI subsystem attempts to show floating Writing Tools affordances when the mouse dwells over text. In WKWebView text selections, an internal AppKit assertion fails (NSCampoLightweightUIController.m:1429), throwing an NSInternalInconsistencyException across tao's send_event FFI boundary, which std aborts (SIGABRT). Setting writingToolsBehavior = -1 (NSWritingToolsBehaviorNone) on WKWebViewConfiguration before initialization opts out of Writing Tools and eliminates the crash. On Windows and Linux, without_writing_tools is a compile-time no-op. Closes simion#355
simion
approved these changes
Oct 14, 2026
simion
left a comment
Owner
There was a problem hiding this comment.
Thanks for tracking this down, good catch on the per-window Writing Tools disable.
Owner
|
Nit: NSWritingToolsBehaviorNone is used as a raw -1 literal in two places, a named constant would read better. |
Owner
|
— Simion's agent here, he'll take a look at this shortly. |
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
On macOS 15.1+ (Sequoia / Tahoe 26+), AppKit's
CampoLightweightUIsubsystem detects mouse dwelling over text selections to show floating Apple Intelligence Writing Tools affordances.When inspecting or attaching to
WKWebViewtext selections, an internal AppKit assertion fails (*** Assertion failure in <private>, NSCampoLightweightUIController.m:1429), throwing anNSInternalInconsistencyExceptioninside Cocoa's event loop (-[NSApplication sendEvent:]).Because Tauri's
taohookssendEvent:via anextern "C"Rust callback without unwinding support, the uncaught exception hitting the FFI boundary causes Rust's runtime to triggerpanic_cannot_unwind, terminating the process withSIGABRT("Abort trap: 6").This PR opts out of Writing Tools on macOS by setting
writingToolsBehavior = -1(NSWritingToolsBehaviorNone) onWKWebViewConfigurationbefore the webviews are initialized.Changes
WKWebViewConfigurationwithsetWritingToolsBehavior: -1viawithout_writing_toolsinsrc-tauri/src/lib.rsfor both profile windows and the activity monitor window.#[cfg(target_os = "macos")]and added a compile-time no-op pass-through for#[cfg(not(target_os = "macos"))], ensuring zero impact on Windows and Linux builds.objc2-web-kitwith theWKWebViewConfigurationfeature insrc-tauri/Cargo.toml.test_writing_tools_behavior_opt_outassertingwritingToolsBehavioris set to-1on supported macOS runtimes.Verification
Focused input fields and selected text, then repeatedly switched back and forth across applications with Cmd+Tab while resting the cursor over the text.
Confirmed that Termic remains fully stable without crashes, dwelling triggers no Campo assertion failures, and right-clicking selected text cleanly omits Writing Tools affordances.
cargo test --workspace --lib: 1,354 lib tests, 85 cli tests, and 21 proto tests passed.npm test: All 206 test files and 3,281 tests passed.npm run build: Passed cleanly with zero TypeScript or Vite bundle errors.Closes #355