diff --git a/apps/web/src/components/ChatView.tsx b/apps/web/src/components/ChatView.tsx index 0635064eab5b284120f126eb256621580230164e..0df78d8275df08cd3f8e33da53e6b050cab38b95 100644 --- a/apps/web/src/components/ChatView.tsx +++ b/apps/web/src/components/ChatView.tsx @@ -368,17 +368,19 @@ export default function ChatView() { if (e.key === "o" && (e.metaKey || e.ctrlKey) && !e.shiftKey) { if (api && activeProject) { e.preventDefault(); - void api.shell.openInEditor(activeProject.cwd, lastEditor); + const cwd = activeThread?.worktreePath ?? activeProject.cwd; + void api.shell.openInEditor(cwd, lastEditor); } } }; window.addEventListener("keydown", handler); return () => window.removeEventListener("keydown", handler); - }, [api, activeProject, lastEditor]); + }, [api, activeProject, activeThread, lastEditor]); const openInEditor = (editorId: EditorId) => { if (!api || !activeProject) return; - void api.shell.openInEditor(activeProject.cwd, editorId); + const cwd = activeThread?.worktreePath ?? activeProject.cwd; + void api.shell.openInEditor(cwd, editorId); setLastEditor(editorId); localStorage.setItem(LAST_EDITOR_KEY, editorId); setIsEditorMenuOpen(false);