Repository navigation
Set ELECTRON_RUN_AS_NODE=1 in the --split window command - #46
Open
zenbu-bot[bot] wants to merge 1 commit into
Open
zenbu-bot[bot] wants to merge 1 commit into
zenbu-bot[bot] wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
zenbu-bot
Bot
force-pushed
the
zenbu/issue-36
branch
from
October 30, 2026 18:50
1a683ba to
f91c3fc
Compare
Fixes #36 [skip ci]
zenbu-bot
Bot
force-pushed
the
zenbu/issue-36
branch
from
October 30, 2026 21:09
f91c3fc to
c22ecb2
Compare
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #36
Problem
tode --split rightin Ghostty starts the new pane's window process withoutELECTRON_RUN_AS_NODE=1. On an x86_64 Mac, Electron Helper then boots Chromium, its GPU process crashes 9 times, and the process exits with code 133 (SIGTRAP).Cause
windowCommand()insrc/launch.tsreturns[process.execPath, main.js, "--window", url]and sets no environment. A Ghostty split pane starts with Ghostty's environment, not the caller's. So theexport ELECTRON_RUN_AS_NODE=1in thebin/todeshim does not reach the pane. Without that variable,process.execPath(Electron Helper) starts as a Chromium browser process.Change
windowCommand()now prefixes the command with/usr/bin/env ELECTRON_RUN_AS_NODE=1. The window process now runs as node in any terminal's split, whatever environment the pane starts with.Tests
Added
test/split-window-env.test.js. It replaces Ghostty with a fake that records the split command, then checks thatELECTRON_RUN_AS_NODE=1comes beforeprocess.execPath. It fails on base and passes with the change. The full suite passes: 129 pass, 0 fail. The demo ran in real Ghostty on an Intel Mac (x86_64). On base, the pane command boots Chromium and exits with code 133. With the change, it runs as node and starts no GPU process.Evidence
Before:
before.mp4
After:
after.mp4
Test
test/split-window-env.test.jsbefore the fix (fails):After (passes):
Extra information
41124456218-1issue.actsrc/launch.ts,test/split-window-env.test.jsnpx tsc -p tsconfig.json > /dev/null; node scripts/write-cjs-boundary.js && node --test "test/*.test.js"/usr/bin/env ELECTRON_RUN_AS_NODE=1. The diff also adds one hermetic test that swaps in a fake terminal module; it adds no network, credential, config or install-hook changes.main@b049d7c