| author | |
| committer | |
| log | f8f091ba7269f62f2a325083a02ed25ef1de77f2 |
| tree | 79e841b0d4c49c8c91dacd31ba406f06ecb7e01e |
| parent | 324d9364aab99a3828fd57085de6970258f52b0c |
| signature | Signed by SSH key SHA256:52mNGHRsVFBDED9IAX5pe+LRWUefqTbxEReunq21QvU |
Select UTF-8 explicitly on both host and guest clipboard tools, and document the installed access helper and verified GUI environment.
Assisted-by: gpt-6-astra4 files changed, 22 insertions(+), 8 deletions(-)
tools/code-vm+2-2| ... | ... | @@ -7,10 +7,10 @@ import sys |
| 7 | 7 | |
| 8 | 8 | helper = str(Path(__file__).resolve().with_name("mac-agent-vm.py")) |
| 9 | 9 | if sys.argv[1:] == ["--clipboard"]: |
| 10 | with subprocess.Popen(["/usr/bin/pbpaste"], stdout=subprocess.PIPE) as clipboard: | |
| 10 | with subprocess.Popen(["/usr/bin/pbpaste"], env={**os.environ, "LC_CTYPE": "en_US.UTF-8"}, stdout=subprocess.PIPE) as clipboard: | |
| 11 | 11 | try: |
| 12 | 12 | result = subprocess.run( |
| 13 | [sys.executable, helper, "exec", "/usr/bin/pbcopy"], | |
| 13 | [sys.executable, helper, "exec", "/usr/bin/env", "LC_CTYPE=en_US.UTF-8", "/usr/bin/pbcopy"], | |
| 14 | 14 | stdin=clipboard.stdout, |
| 15 | 15 | ) |
| 16 | 16 | finally: |
tools/mac-agent-vm.md+17-4| ... | ... | @@ -95,7 +95,8 @@ force-off, deletion, and preset creation are unavailable for this managed VM. |
| 95 | 95 | |
| 96 | 96 | ## Guest access |
| 97 | 97 | |
| 98 | `~/.local/bin/code-vm` links to `tools/code-vm`: | |
| 98 | `~/.local/bin/code-vm` links to the installed `runtime/control/code-vm` under | |
| 99 | the VM home, alongside its helper: | |
| 99 | 100 | |
| 100 | 101 | ```sh |
| 101 | 102 | code-vm # Interactive SSH shell |
| ... | ... | @@ -192,9 +193,21 @@ deliberately between test runs, then recheck GUI permissions and boot. |
| 192 | 193 | |
| 193 | 194 | Initial provisioning installed Rust/Cargo 1.99.1, Node 24.22.0 LTS, npm 11.19.1, |
| 194 | 195 | pnpm 12.14.0, Jujutsu 0.42.0, and Apple's CLT with Clang 17 and the macOS SDK. |
| 195 | Subsequent guest setup manages toolchain versions and paths. Login shells load | |
| 196 | their paths from `~/.zprofile` or `~/.profile`; use | |
| 197 | `exec /bin/zsh -lc ...` for development commands. | |
| 196 | Subsequent guest setup manages toolchain versions and paths in | |
| 197 | `~/config/users/clover/agents/vm` on the host. Its installed `env.zsh` is linked | |
| 198 | from the guest's `~/.zshenv`, including non-login shells. The development | |
| 199 | LaunchAgent publishes the same environment to newly launched GUI apps. Existing | |
| 200 | apps retain their inherited environment until relaunched. `/bin/zsh` has a | |
| 201 | separate guest Full Disk Access approval so launchd can read this configuration | |
| 202 | on Code. The Apple-tools LaunchAgent retries failed image attachment every | |
| 203 | 30 seconds and recognizes already mounted images. | |
| 204 | ||
| 205 | On 2026-10-20, a fresh launchd process resolved Cargo, Node, pnpm, and Zig and | |
| 206 | reported the Code-backed cache paths. Existing Apple and kache mounts remained | |
| 207 | available. A Mac restart was explicitly deferred by Clover; these live checks | |
| 208 | do not establish cold-boot recovery. A dashboard clipboard round-trip preserved | |
| 209 | accented text, emoji, and Japanese text with UTF-8 selected explicitly for | |
| 210 | `pbcopy` and `pbpaste`. | |
| 198 | 211 | |
| 199 | 212 | ## Provenance |
| 200 | 213 |
tools/mac-vm-bridge.py+2-1| ... | ... | @@ -74,7 +74,8 @@ def main(): |
| 74 | 74 | value = request["text"] |
| 75 | 75 | if not isinstance(value, str) or len(value.encode()) > 262144: |
| 76 | 76 | raise ValueError("Shorten the clipboard text, then send it again.") |
| 77 | vm.tart("exec", "-i", vm.NAME, "/usr/bin/pbcopy", input=value.encode(), capture_output=True, timeout=15) | |
| 77 | vm.tart("exec", "-i", vm.NAME, "/usr/bin/env", "LC_CTYPE=en_US.UTF-8", "/usr/bin/pbcopy", | |
| 78 | input=value.encode(), capture_output=True, timeout=15) | |
| 78 | 79 | respond({"value": None}) |
| 79 | 80 | elif action == "console" and set(request) == {"action"}: |
| 80 | 81 | with vm.guest_screen() as upstream: |
tools/mac-vm-test.py+1-1| ... | ... | @@ -38,7 +38,7 @@ class MacVMTests(unittest.TestCase): |
| 38 | 38 | with patch.object(sys, "stdin", io.TextIOWrapper(io.BytesIO(request))), \ |
| 39 | 39 | patch.object(bridge.vm, "tart") as tart, patch.object(bridge, "respond") as respond: |
| 40 | 40 | bridge.main() |
| 41 | self.assertEqual(tart.call_args.args, ("exec", "-i", "gui-agent", "/usr/bin/pbcopy")) | |
| 41 | self.assertEqual(tart.call_args.args, ("exec", "-i", "gui-agent", "/usr/bin/env", "LC_CTYPE=en_US.UTF-8", "/usr/bin/pbcopy")) | |
| 42 | 42 | self.assertEqual(tart.call_args.kwargs["input"], value.encode()) |
| 43 | 43 | respond.assert_called_once_with({"value": None}) |
| 44 | 44 |