Skip to content

feat(automations): run a node in WSL — Ubuntu with its own Docker, say - #16

Merged
Sniphs98 merged 6 commits into
mainfrom
feat/dashboard-folders
Sep 26, 2026
Merged

Sniphs98 merged 6 commits into
mainfrom
feat/dashboard-folders

Conversation

@Sniphs98

Copy link
Copy Markdown
Owner

Where a node runs is now "local | WSL | on host". WSL runs the snippet with bash
in a chosen distribution (or the default one) on this machine, so Linux commands
and a Docker installed inside WSL work in automations; no host parameter needed.
The option shows where wsl.exe lists a distribution (Docker Desktop's internal
ones left out), and stays on a node that already uses it.

The command goes over as an environment variable shared through WSLENV and runs
as wsl.exe -d <distro> --exec bash -lc 'eval "$BSSH_COMMAND"': nothing in it is
re-parsed by Windows or an extra shell (-- would, and lost the quotes). It
starts in the Windows home folder (/mnt/c/Users/), where local nodes run and
an upload node's relative path points, so the steps hand files to each other.
wsl.exe's own failures (no such distribution) come back as its message rather
than an exit code of 4294967295.

Stored as target = "wsl" plus wslDistro; export and import carry both.

Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com

What and why

How it was tested

Checklist

  • PR title is a Conventional Commit (it decides the release)
  • npm run check and npm test pass
  • Tests added or updated for the change
  • README updated if the change is user-visible

Sniphs98 and others added 6 commits September 26, 2026 17:19
Where a node runs is now "local | WSL | on host". WSL runs the snippet with bash
in a chosen distribution (or the default one) on this machine, so Linux commands
and a Docker installed inside WSL work in automations; no host parameter needed.
The option shows where wsl.exe lists a distribution (Docker Desktop's internal
ones left out), and stays on a node that already uses it.

The command goes over as an environment variable shared through WSLENV and runs
as `wsl.exe -d <distro> --exec bash -lc 'eval "$BSSH_COMMAND"'`: nothing in it is
re-parsed by Windows or an extra shell (`--` would, and lost the quotes). It
starts in the Windows home folder (/mnt/c/Users/<you>), where local nodes run and
an upload node's relative path points, so the steps hand files to each other.
wsl.exe's own failures (no such distribution) come back as its message rather
than an exit code of 4294967295.

Stored as target = "wsl" plus wslDistro; export and import carry both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r shell

A "Local terminal" row under Terminal opens a shell on this computer in a tab,
no SSH needed, picked from the shells found here the way VS Code's terminal
offers them: PowerShell 7, Windows PowerShell, Command Prompt, Git Bash and every
WSL distribution on Windows (Docker Desktop's internal ones left out); the login
shell and the other installed ones on macOS and Linux. Tabs start in the home
folder (a WSL one in the distribution's home) and close when the shell exits.

Backed by node-pty, as VS Code is, so full-screen programs and line editing work.
LocalPtyManager mirrors the SSH PtyManager — same session ids, output channel and
exit event — so the existing terminal view drives both; write/resize/close go to
whichever manager has the id. node-pty loads on first use: where it can't, only
local terminals are affected, with a message saying so.

Packaging: node-pty is N-API with prebuilt binaries (built on install on Linux),
so it needs no rebuild for Electron, and electron-builder's rebuild would send it
to node-gyp. That rebuild is off; build/rebuild-native.cjs does the same rebuild
in beforePack with node-pty left out. node-pty's folder is unpacked from the asar
for its helper programs. Its install script is approved for npm's allowScripts.

Also: output and events are no longer sent to a destroyed window — a shell still
talking while the app quit raised "Object has been destroyed" in the main process.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s shells on top

The dashboard's cards now sit in accordion sections: one per folder,
alphabetical, then the hosts in none ("Hosts", or "Other hosts" once there are
folders). Above them, always first, "This computer" has a tile per local shell
(PowerShell, Command Prompt, Git Bash, each WSL distribution …) that opens it in
a tab.

A host's folder is set in its editor (Folder, suggesting the ones in use; a new
name makes a new folder) or by dragging its card onto another section. Stored as
`folder` in hosts.toml. Collapsed sections are remembered per machine; while
searching every section is open and ones without a match are left out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The dashboard's "This computer" tiles open local shells now, so the sidebar
row and its profile menu are gone; the sidebar is back to Dashboard,
Automations, Snippets, SFTP and Terminal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Local terminals failed on macOS with "posix_spawnp failed": node-pty starts
every shell through its spawn-helper, and node-pty 1.1.0's npm package ships
that file as -rw-r--r--. The app now sets the executable bit where it is
missing before loading node-pty (development, CI), and the packaging hook sets
it before the files are copied, so the macOS app ships it executable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Sniphs98
Sniphs98 merged commit b6f14f6 into main Sep 26, 2026
9 checks passed
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