Embedded code editor
Ghostex embeds a full VS Code workbench through code-server inside native Chromium panes. Open files, diffs, git views, and PR review without leaving the project workspace.
What it is
The embedded code editor is a project-scoped code-server instance hosted in Chromium/CEF, not a separate VS Code app window. Ghostex starts one shared code-server runtime per awake editor need, then mounts CEF surfaces for Code, Git, and Project (tasks) modes.
Installed macOS builds package the full code-server runtime (Node 22), ripgrep, and validate bundled contents during release builds. The same Node binary also powers gxserver.
How it works
Opening a project editor follows this native flow:
- Ghostex focuses the target project group.
- The sidebar starts or reuses the shared code-server process with project-scoped CLI flags.
- AppKit creates a CEF-backed project editor pane (modes: code, git, tasks).
- VS Code workbench layout persists in browser-side storage tied to the editor session — not a throwaway CEF profile.
- When no awake editor surfaces remain, Ghostex stops the shared code-server runtime.
Code-server editor panes are project surfaces, not split terminal sessions. The sidebar models them as synthetic editor rows with git diff stats in project headers instead of a separate code-editor sidebar section.
Workarea views and modes
Ghostex exposes editor surfaces through workarea tabs and project editor modes:
| Option | What it does |
|---|---|
Source (Alt+2) | Opens/focuses the embedded VS Code code editor for the active project. Session-card clicks in Source view retarget the companion pane without tearing down the embed. |
Git editor mode | Project-scoped git diff/review surface inside the same code-server runtime. |
Tasks / Project mode | Project board and tasks WKWebView hosted alongside code-server panes. |
Companion pane | When Code is active, Ghostex can keep the current terminal or T3 Code session visible as a left companion pane. |
Project group headers and titlebar actions call openProjectEditorForGroup so Code opens in the clicked project’s cwd, not whichever project happened to be focused earlier.
Opening files and diffs
Ghostex routes file-open requests through code-server IPC:
- Clicking files from git modals, Agents Hub, or sidebar actions can open paths in the embedded editor.
- IPC uses a Unix socket at ~/.ghostex/code-server-runtime/user-data/code-server-ipc.sock.
- Wake/focus ensures the project editor is awake before non-wait file requests land.
- External editor commands (code, cursor, zed, etc.) remain available through Settings → Editor for out-of-app editing.
Startup failures (missing runtime, Git native module issues) surface as sidebar row errors and toasts with actionable guidance instead of a raw code-server 500 page.
Options and settings
Settings → Editor:
| Option | What it does |
|---|---|
codeServerLinkVscodeUserConfig | Label: "Use VS Code settings". Opt in to link local VS Code user settings instead of Ghostex bundled defaults (default off). |
codeServerUseVscodeInsidersUserConfig | Label: "Use VS Code Insiders settings". Switches linked directory to Code - Insiders when linking is enabled. |
defaultEditorCommand | External editor for Agents Hub and Open In actions: code, code-insiders, zed, cursor, windsurf, codium, subl, or Other. |
hideProjectHeaderDiffStats | Hide +added/-removed line counts beside project headers. |
showProjectEditorDiffFileCount | Show changed-file counts in project-header git stats. |
showUntrackedProjectDiffWhenNoTrackedChanges | When tracked diff is +0 -0, show untracked line totals in project headers. |
Settings → Auto Sleep (defaults):
| Option | What it does |
|---|---|
autoSleepCodeEditorEnabled | Sleep inactive VS Code panes (default on, 15 minutes idle). |
autoSleepGitEditorEnabled | Sleep inactive Git panes (default on, 15 minutes idle). |
autoSleepProjectEditorEnabled | Sleep inactive Project panes (default on, 15 minutes idle). |
Idle minute choices: 5, 10, 15, 30, 60, 120, or 300. Changing VS Code settings link flags restarts awake editor processes so new launch options apply.
Bundled VS Code defaults
New installs use Ghostex-owned bundled editor settings so the embedded surface starts on the Dark 2026 theme without importing your local VS Code config unexpectedly.
- Enable Use VS Code settings when you want extensions, themes, and keybindings from ~/Library/Application Support/Code/User.
- Insiders checkbox only applies when linking is enabled and points at Code - Insiders user data.
- Packaged builds materialize target-architecture ripgrep and fetch authenticated GitHub artifacts during release builds.
Keyboard shortcuts
Ghostex workspace shortcuts while the code editor is focused:
| Option | What it does |
|---|---|
Alt+2 | Switch to Source view / focus embedded Code for the active project. |
Alt+1 / Alt+3 / Alt+4 | Switch to Agents, GitHub/Browser, or Kanban workarea views. |
DevTools (pane chrome) | Toggle Chromium DevTools for the project editor CEF surface. |
VS Code keybindings inside the embed follow code-server defaults or your linked user settings when codeServerLinkVscodeUserConfig is enabled.
CLI commands
Ghostex does not expose a dedicated ghostex code user command. Editor panes are opened from the UI (Source view, project headers, git flows).
Related CLI surfaces:
ghostex switch-project --path /path/to/repo
ghostex add-project /path/to/repo --name my-projectAgents and git workflows inside Ghostex call native sidebar actions that wake the code-server runtime and open file paths over IPC.
Layout and stability
- Embedded Code, Git, and browser panes stay visually stable while the command pane is resized.
- Showing or hiding the command pane no longer shifts editor page content upward after repeated resizes.
- VS Code panel/sidebar drag-and-drop keeps live hover targets while using CEF.
- Native pane resize/header reorder interception is disabled while editor panes are visible so VS Code owns drag gestures.
- Closing a pane from the sidebar tears down the CEF surface without closing the top-level Ghostex window.
Tips
- Use Alt+2 to jump straight to the embedded editor for the focused project.
- Keep bundled settings for a consistent Dark 2026 onboarding experience; link local VS Code settings only when you need your existing extension set.
- Let auto-sleep retire idle Code/Git/Project panes — focusing the project wakes code-server back into the same folder.
- Watch project-header git stats for +added/-removed summaries without opening the editor.
- If code-server fails to start, check Integrations/runtime toasts — missing packaged runtime is treated as an app integrity issue, not an install-Node problem.