Skip to content

spawnMspConnection spawns muse serve without windowsHide and offers no option for it #34

Open

Description

@RandyNorthrup

Where is the problem? The TypeScript SDK: spawnMspConnection / MuseServeChild.spawn in dist/src/connection/spawn.js.

What happened, and what did you expect instead?

MuseServeChild.spawn builds its child_process.spawn options from cwd, env and detached only (1.3.0, connection/spawn.js around line 363):

const spawnOptions = {
    ...(options.cwd === undefined ? {} : { cwd: options.cwd }),
    ...(options.env === undefined ? {} : { env: options.env }),
    detached: ownsProcessGroup,
};

On Windows there is no windowsHide, and spawnMspConnection does not accept one. Node's default is windowsHide: false. When the host process has no console of its own, for example a GUI app, a Windows service helper, or an Electron main process, Windows gives the console program muse serve a new console window. The window stays open as long as the connection does.

We have not seen a window in a VS Code extension. The extension host runs with a hidden console, and muse serve inherits it. The risk comes from the host's setup, not from anything the SDK controls.

What I expected: either the SDK passes windowsHide: true itself, as muse serve is never meant to be seen, or spawnMspConnection accepts spawn options such as windowsHide, so a client can choose.

For reference, our client passes windowsHide: true on every other spawn it makes, and records this one as the exception (https://github.com/RandyNorthrup/muse-spark-code, PLAN.md D25).

Version and environment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions