---
name: git-bash-tasklist-fi-mangles-to-a-path
description: "In Git Bash `tasklist /FI \"PID eq N\"` becomes `tasklist 'C:/Program Files/Git/FI'` (MSYS path conversion); it errors, the grep sees nothing, and a liveness check reads a LIVE driver as DEAD. Use `//FI` (or MSYS_NO_PATHCONV=1) and test the check against a pid you know is alive."
metadata: 
  node_type: memory
  type: feedback
  originSessionId: 647c7dc2-d1c2-49f5-9513-98ffb742a36a
  modified: 2026-09-07T02:57:41.518Z
---

2026-09-07 02:57Z: my Monitor's driver-death arm was `tasklist /FI "PID eq $PID" | grep -q $PID`. Git Bash
rewrote `/FI` to `C:/Program Files/Git/FI` (MSYS converts a leading-slash token into a path), tasklist printed
`ERROR: Invalid argument/option - 'C:/Program Files/Git/FI'`, the grep matched nothing, and the Monitor
reported `DRIVER PROCESS GONE without BATTERY DONE` while driver pid 36952 was alive and one leg in. The
earlier session's monitor had the same arm and had fired the same false death on the first driver.

**Why:** the failure is silent to the caller: a non-zero tasklist with the error on stderr looks, through
`grep -q`, exactly like "pid absent". A liveness check that cannot tell "absent" from "the query failed"
reads every query failure as death, and a false death invites a kill or a relaunch beside a live lane.

**How to apply:**
- Escape the slash: `tasklist //FI "PID eq $PID"`, or set `MSYS_NO_PATHCONV=1` for the call. Same for
  every Windows tool flag in Git Bash (`/T`, `/F`, `/S` all convert). PowerShell tool calls do not convert.
- Test the arm on a pid you KNOW is alive before arming a monitor on it; a death check that has never
  returned "alive" once is unproven.
- Make the check fail closed: require the pid to appear in the output AND the command to exit 0; treat any
  other outcome as "unknown, re-check", never as "gone".
- Related: [[empty-tasklist-is-not-a-dead-background-task]] (the other way an empty tasklist lies),
  [[a-stopped-local-ssh-does-not-stop-its-remote-command]] (a death the harness reports that is not one).
