Skip to content

Run spawn with path to electron as working directory - #213

Open
muffinista wants to merge 1 commit into
electron:mainfrom
muffinista:path-to-electron-cwd
Open

Run spawn with path to electron as working directory #213
muffinista wants to merge 1 commit into
electron:mainfrom
muffinista:path-to-electron-cwd

Conversation

@muffinista

Copy link
Copy Markdown

On linux, when a fiddle runs, the path to the electron binary will be something like /home/username/.config/Electron Fiddle/electron-bin/current/chrome-sandbox or something along those lines. But the noteworthy thing here is that the path has a space in it. When spawn is passed this as an argument, it thinks /home/username/.config/Electron is the binary, and since that doesn't exist, the command won't run and throws an error such as:

LaunchProcess: failed to execvp:
/home/username/.config/Electron

There's two obvious ways to try and deal with this. The first option is to explore escaping the path. tbh I tried that, it didn't work, so I moved onto the second (and probably better anyway) option, which is to call spawn with the name of the binary as the primary argument, and the path to the binary as the cwd argument.

This should fix electron/fiddle#1800 and I think electron/fiddle#1598. Without it, I think it's impossible to run fiddle on Ubuntu. I wrote this PR to fix fiddle so I can file a report on electron.

@muffinista
muffinista requested a review from a team as a code owner June 25, 2026 01:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fiddle fails to run on Ubuntu

1 participant