Skip to content

Preserve environment when spawning sshfs#236

Open
Evesain wants to merge 1 commit into
evsar3:masterfrom
Evesain:codex/preserve-spawn-env-for-sshfs
Open

Preserve environment when spawning sshfs#236
Evesain wants to merge 1 commit into
evsar3:masterfrom
Evesain:codex/preserve-spawn-env-for-sshfs

Conversation

@Evesain

@Evesain Evesain commented Jun 20, 2026

Copy link
Copy Markdown

Summary

Preserve the existing Windows process environment when launching sshfs.exe, while still prepending the SSHFS-Win binary directory to PATH.

Root cause

ProcessHandlerWin currently spawns sshfs.exe with an environment containing only:

env: {
  PATH: dirname(this.settings.sshfsBinary)
}

On current Windows setups this can break SSHFS-Win/Cygwin process startup before it reaches the remote SSH server. In my case SSHFS-Win Manager stayed stuck in connecting, while direct SSH still worked. Reproducing the Manager launch command produced:

failed to create socket pair: Permission denied

Keeping the normal Windows environment and prepending SSHFS-Win's directory allows sshfs.exe to start normally while still resolving the bundled SSHFS-Win binaries first.

Validation

  • Reproduced the failure locally with the existing stripped environment.
  • Verified the fixed launch behavior by patching the installed app bundle and successfully mounting multiple SSHFS-Win Manager entries.
  • Ran node --check src/renderer/ProcessHandlerWin.js.
  • Ran git diff --check.

npm ci was not runnable on the current upstream checkout because package.json and package-lock.json are already out of sync for several dependencies; this PR intentionally avoids lockfile churn.

@Evesain
Evesain marked this pull request as ready for review June 20, 2026 15:38
@Evesain

Evesain commented Jul 5, 2026

Copy link
Copy Markdown
Author

@evsar3 @lancetekk @BRTPOB could this be looked into and implemented?

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.

1 participant