Skip to content

fix(windows): Engram Git subprocesses open transient terminal windows #599

Description

@MarsSall

Pre-flight Checks

  • I searched the existing issues and confirmed this is not a duplicate.
  • I understand this issue requires status:approved before a PR can be opened.

Bug Description

Starting Pi causes several transient console or Windows Terminal windows to appear. The same behavior occurs when Pi launches subagents.

Process monitoring identified Git commands spawned by engram serve as the primary source. These subprocesses create conhost.exe, which can subsequently activate OpenConsole.exe or WindowsTerminal.exe.

Steps to Reproduce

  1. Install and enable gentle-engram in Pi on native Windows.
  2. Ensure no Engram daemon is currently running.
  3. Start a new Pi session.
  4. Observe several transient terminal windows.
  5. Launch a Pi subagent.
  6. Observe the windows appearing again.

Expected Behavior

Engram and its Git subprocesses should run silently in the background without creating or activating visible terminal windows.

Actual Behavior

Engram executes repository-discovery commands such as:

git rev-parse --show-toplevel
git remote get-url origin

The observed process chain was:

engram serve
└─ git.exe
   └─ conhost.exe
      └─ OpenConsole.exe / WindowsTerminal.exe

This caused multiple terminal windows to appear briefly during Pi startup and subagent creation.

Operating System

Windows

Engram Version

Engram 1.19.0

Agent / Client

Other: Pi Coding Agent 0.80.6

The session runs on native Windows using Nushell inside WezTerm.

Relevant Logs

engram.exe
Command line: engram serve

git.exe
Parent: engram.exe
Command line:
git -C "<project>" rev-parse --show-toplevel

conhost.exe
Parent: git.exe
Command line:
\??\C:\WINDOWS\system32\conhost.exe 0x4

git.exe
Parent: engram.exe
Command line:
git -C "<project>" remote get-url origin

OpenConsole.exe
Command line:
WindowsTerminal\OpenConsole.exe -Embedding

Additional Context

A local workaround was applied in:

gentle-engram/index.ts

The detached process configuration was changed to:

proc = spawn(command, [...args], {
  cwd,
  detached: true,
  stdio: "ignore",
  windowsHide: true,
});

The existing Engram daemon was then stopped and restarted so it inherited the corrected process configuration.

After applying the workaround:

  • no Engram-owned Git processes produced visible consoles;
  • no OpenConsole.exe or WindowsTerminal.exe processes appeared during startup;
  • the user confirmed that no windows appeared visually.

Pi also runs multiple package update checks through:

pnpm view <package> version --json

Those checks were observed using cmd.exe, but they did not produce visible windows during the final verification.

The workaround currently modifies node_modules directly and is therefore overwritten by package upgrades or reinstalls. The fix should be incorporated into gentle-engram itself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions