From 59dbe839135a5e9a48aa08d457796fc44ea3dd23 Mon Sep 17 00:00:00 2001 From: ayamir <61657399+ayamir@users.noreply.github.com> Date: Wed, 9 Sep 2026 17:05:58 +0800 Subject: [PATCH] feat(macos): add default terminal integration (#818) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat(macos): add default terminal integration * fix(macos): route external opens through the layout pull Five holes in the LaunchServices path, all on the way from a URL to a tab. The `ssh:` arm handed the raw URL back to `parse_quick_connect`, which reads a bare `user@host:port` typed into Quick Connect. Everything a URL carries past the authority landed in the wrong field: `ssh://h:2200/` parsed its port as `2200/` and was dropped on the floor, `ssh://h/srv` became the host `h/srv`, and the percent escapes `url` was added for were never decoded. Read the authority off the parsed URL instead. `x-man-page://3/printf` is Apple's sectioned form, and taking the host as the page name ran `man 3`, which asks the user what page they wanted. Section and page are now both carried. A window that is pulling its layout is one `Adopt::IfEmpty` will not adopt into, so a tab inserted while the pull is out comes back as the whole workspace — the failure `then_open` already exists to avoid. Both the script/man path and the SSH path inserted straight into a freshly restored window, so `then_open` becomes a list of parked requests and carries a command or an SSH link as well as a folder. A cold `ssh://` link also went through `open_at` directly, claiming a fresh workspace and leaving the restored one detached and unannounced; it takes the shared restore now. `new_tab_running` wrote the command whether or not a tab opened, so a failed spawn typed a script path and a newline into whatever pane was focused before — a shell mid-line, or an agent. Left alone deliberately: an `ssh://` link still connects without a confirmation, which is a product call rather than a defect. Claude-Session: https://claude.ai/code/session_01E4EPKzHg1fm9HMmHkUYpER --------- Co-authored-by: l0ng-ai <24760907+l0ng-ai@users.noreply.github.com> --- .github/scripts/bundle-macos.sh | 33 ++++ Cargo.lock | 2 + Cargo.toml | 7 + src/core/default_terminal.rs | 277 ++++++++++++++++++++++++++++++++ src/core/mod.rs | 1 + src/main.rs | 122 ++++++++++---- src/ui/app.rs | 35 ++++ src/ui/i18n/en.rs | 11 ++ src/ui/i18n/ja.rs | 11 ++ src/ui/i18n/mod.rs | 5 + src/ui/i18n/zh.rs | 9 ++ src/ui/settings.rs | 34 ++++ src/ui/tree_sync.rs | 183 ++++++++++++++++++--- src/ui/windows.rs | 109 +++++++++++++ 14 files changed, 781 insertions(+), 58 deletions(-) create mode 100644 src/core/default_terminal.rs diff --git a/.github/scripts/bundle-macos.sh b/.github/scripts/bundle-macos.sh index f488a70c..84ccc934 100755 --- a/.github/scripts/bundle-macos.sh +++ b/.github/scripts/bundle-macos.sh @@ -72,6 +72,39 @@ cat > "$APP/Contents/Info.plist" <CFBundlePackageTypeAPPL NSHighResolutionCapable NSPrincipalClassNSApplication + + CFBundleDocumentTypes + + + CFBundleTypeNameFolder + CFBundleTypeRoleEditor + LSHandlerRankAlternate + LSItemContentTypespublic.directory + + + CFBundleTypeNameShell Script + CFBundleTypeRoleShell + LSItemContentTypespublic.shell-script + + + CFBundleTypeNameUnix Executable + CFBundleTypeRoleShell + LSItemContentTypespublic.unix-executable + + + CFBundleURLTypes + + + CFBundleURLNameSSH + CFBundleURLSchemesssh + + + CFBundleURLNameMan Page + CFBundleURLSchemesx-man-page + +