Skip to content

fix(macos): Copy menu item works; Seatbelt profile uses real, escaped paths (#1590) - #1703

Merged
ZhuchkaTriplesix merged 1 commit into
devfrom
fix/macos-copy-menu-seatbelt-path
Oct 17, 2026
Merged

ZhuchkaTriplesix merged 1 commit into
devfrom
fix/macos-copy-menu-seatbelt-path

Conversation

@ZhuchkaTriplesix

Copy link
Copy Markdown
Member

Refs #1590 (items 1 and 2, and the escaping from item 3; narrowing the profile is not in this PR).

Copy menu item (querya_platform_menu_bar.dart): it was const PlatformMenuItem(label: 'Copy', ...) with no onSelected, which Flutter draws disabled. It now invokes CopySelectionTextIntent.copy on the focused widget, the way Cut, Paste and Select All already do.

Seatbelt paths (sandbox_launch_command.dart): the scratch directory is under Directory.systemTemp (/var/folders/...), and /var is a link to /private/var. Seatbelt matches subpath against the real path, so (allow file-write* (subpath "/var/folders/...")) would never match and the extension could not write its scratch. The macOS command now resolves the scratch and extension roots with resolveSymbolicLinksSync before building the profile (a path that does not exist is kept as given).

Escaping: scratchPath and extensionRoot were put into the profile between quotes as-is; a " in a path could end the string and add a rule. They now go through seatbeltString, which escapes \ and ".

Not done: narrowing (allow mach-lookup), (allow process*) and the file-read* outside /Users. A too-narrow profile stops extension processes from starting, and I have no Mac to find what they really need, so this stays in #1590. The path fix is also unverified on a Mac (the issue says items 1-2 need confirmation there); the logic is covered by tests on Linux.

Tests: a quote and a backslash in the scratch path are escaped and an injected rule in the extension root stays inside its string; a symlinked scratch and extension root appear in the profile by their real path; a missing path is kept.

@github-actions github-actions Bot added bug Something isn't working stability Theme parser epic label: stability P2 Medium priority / Parity & Refactoring labels Oct 17, 2026
@ZhuchkaTriplesix
ZhuchkaTriplesix merged commit 4a75157 into dev Oct 17, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working P2 Medium priority / Parity & Refactoring stability Theme parser epic label: stability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant