Skip to content

Commit ac0aa5c

Browse files
levochkaaclaude
andcommitted
feat(editors): Open in lists the Mac apps you have installed and supports more of them
On macOS, Open in decided an editor was installed when its CLI was on PATH. The Cursor Agent CLI's `cursor` shim made Cursor look installed without the IDE, and apps without a CLI, like Warp, could not be offered at all. On macOS the server now asks LaunchServices which apps are registered, by bundle id, in one `osascript` call. An app counts as installed when it is registered or when its CLI resolves into an app bundle; a CLI outside any app does not count. Each app opens through its own bundled CLI when it has one, otherwise through `open -b`. Linux and Windows keep PATH discovery, and so does macOS when `osascript` cannot run. This adds Xcode, Sublime Text, Devin Desktop, Android Studio, Nova and BBEdit, plus terminals (Terminal, iTerm2, Ghostty, kitty, WezTerm, Warp) and git clients (GitHub Desktop, Fork, Sourcetree). Terminals run a script handed to them, so these folder-only apps receive a file's folder, and file actions do not offer them. WezTerm ignores folders handed over by LaunchServices, so it starts through `wezterm start --cwd`. JetBrains IDEs count `--column` from 0, so a `file:12:4` target landed one column to the right in every JetBrains IDE. Columns are now passed zero-based. Co-authored-by: Claude Opus 5.5 <[email protected]>
1 parent 54346a6 commit ac0aa5c

16 files changed

Lines changed: 987 additions & 53 deletions

File tree

‎apps/desktop/src/ipc/methods/window.ts‎

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ import {
1414
type PickedThemeFile,
1515
} from "@t3tools/contracts";
1616
import { PROJECT_FAVICON_EXTENSIONS } from "@t3tools/shared/projectFavicon";
17-
import { resolveEditorCommand } from "@t3tools/shared/editor";
17+
import {
18+
macBundleIdsOf,
19+
resolveEditorInstall,
20+
resolveMacApplications,
21+
} from "@t3tools/shared/editor";
1822
import * as HostProcess from "@t3tools/shared/HostProcess";
1923
import { isRelayTracingEnabled } from "@t3tools/shared/otelEnvironment";
2024
import * as FileSystem from "effect/FileSystem";
@@ -325,10 +329,11 @@ export const probeRemoteEditors = DesktopIpc.makeIpcMethod({
325329
handler: Effect.fn("desktop.ipc.window.probeRemoteEditors")(function* () {
326330
const available: Array<EditorId> = [];
327331
const env = yield* HostProcess.Environment;
328-
for (const editorId of REMOTE_CAPABLE_EDITOR_IDS) {
329-
const editor = EDITORS.find((editor) => editor.id === editorId);
330-
if (editor && Option.isSome(yield* resolveEditorCommand(editor, env))) {
331-
available.push(editorId);
332+
const editors = EDITORS.filter((editor) => REMOTE_CAPABLE_EDITOR_IDS.includes(editor.id));
333+
const macApps = yield* resolveMacApplications(editors.flatMap(macBundleIdsOf), env);
334+
for (const editor of editors) {
335+
if (Option.isSome(yield* resolveEditorInstall(editor, env, macApps))) {
336+
available.push(editor.id);
332337
}
333338
}
334339
return available;

0 commit comments

Comments
 (0)