# NousResearch/hermes-agent · Windows terminal output and Git Bash execution issues

## Open now

- Nothing open on GitHub.

Multiple bugs and fixes related to terminal command execution on Windows, specifically around empty output, exit code 126, select.select() incompatibility with Windows pipe file descriptors, and Git Bash path/environment handling.

## TL;DR

- 7 member(s): 0 open issue(s), 4 closed issue(s), 0 open PR(s), 1 merged PR(s), 2 PR(s) closed without merging.
- A fix was merged to main in PR #21259. Verify it addresses your case.
- **Recommended:** read PR #21259 (and any competing PRs below) before filing. Confirm the merged change covers your symptom.

## Maintainer resolution verdict

- Internal-tracker verdict over this cluster's issue members: `partially_resolved` · deciding PR(s): `pr-21259`. This is distinct from the fix status above. Weigh it yourself.

## How this cluster was grouped

- Link evidence (`STRUCTURAL_PARTIAL`): some members are connected by structural evidence (shared changed files, or a closing/superseded reference); the rest are joined by an automated relevance judgement over their text.
- Members outside that structural core may belong to a different underlying problem.
- Pairwise link density `0.21`: the share of member pairs that carry a link, counting a structural link in full and a relevance-only link at 0.36. `1.00` means every pair is linked.

## Closed / duplicate issues

- #14638: Windows: Terminal exits 126 with empty output on every command (Git Bash backend)
- #16425: \[Bug\]: Windows local terminal commands can complete without returning any output
- #16426: \[Windows\] Terminal tool returns empty output on native Windows
- #25514: # \[Windows\] Terminal foreground commands return empty output (select.select() fails on pipe fds)

## Prior & competing PRs

- **#14644: fix(windows): native Git Bash terminal — exit 126 with empty output**. closed without merge · fix tier `suggested`
  - maintainer direction: category `superseded_by_pr`; implication `superseded`; refs `#12795`, `#13397`
  - _suggested-tier fix detail withheld; re-request with `?tier=all` to include it._
- **#21259: fix(windows): terminal drain + cwd path conversion (salvage #19258)**. merged to main · fix tier `verified`
  - maintainer direction: category `merged`; implication `superseded`
  - files: `tools/environments/base.py`, `tools/environments/local.py`
  - fix hunks:
  - `tools/environments/base.py`

    ```diff
    @@ -489,6 +489,26 @@ def _wait_for_process(self, proc: ProcessHandle, timeout: int = 120) -> dict:
     
             def _drain():
                 fd = proc.stdout.fileno()
    +            # select.select does NOT work on pipe fds on Windows (only sockets).
    +            # Use blocking os.read in a daemon thread instead — safe because
    +            # EOF arrives promptly when bash exits.
    +            if os.name == "nt":
    +                try:
    +                    while True:
    +                        chunk = os.read(fd, 4096)
    +                        if not chunk:
    +                            break
    +                        output_chunks.append(decoder.decode(chunk))
    +                except (ValueError, OSError):
    +                    pass
    +                finally:
    +                    try:
    +                        tail = decoder.decode(b"", final=True)
    +                        if tail:
    +                            output_chunks.append(tail)
    +                    except Exception:
    +                        pass
    +                return
                 idle_after_exit = 0
                 try:
                     while True:
    ```
  - `tools/environments/local.py`

    ```diff
    @@ -3,6 +3,7 @@
     import logging
     import os
     import platform
    +import re
     import shutil
     import signal
     import subprocess
    ```

    ```diff
    @@ -403,6 +404,12 @@ def _run_bash(self, cmd_string: str, *, login: bool = False,
                 )
                 self.cwd = safe_cwd
     
    +        # On Windows, self.cwd may be a Git Bash-style path (/c/Users/...)
    +        # from pwd output. subprocess.Popen needs a native Windows path.
    +        _popen_cwd = self.cwd
    +        if _IS_WINDOWS and _popen_cwd and re.match(r'^/[a-zA-Z]/', _popen_cwd):
    +            _popen_cwd = _popen_cwd[1].upper() + ':' + _popen_cwd[2:].replace('/', '\\')
    +
             proc = subprocess.Popen(
                 args,
                 text=True,
    ```

    ```diff
    @@ -413,7 +420,7 @@ def _run_bash(self, cmd_string: str, *, login: bool = False,
                 stderr=subprocess.STDOUT,
                 stdin=subprocess.PIPE if stdin_data is not None else subprocess.DEVNULL,
                 preexec_fn=None if _IS_WINDOWS else os.setsid,
    -            cwd=self.cwd,
    +            cwd=_popen_cwd,
             )
             if not _IS_WINDOWS:
                 try:
    ```
- **#19258: fix(windows): terminal drain and cwd path conversion**. closed without merge
  - maintainer direction: category `silent_close`; implication `active`

## Fix status

- Merged to main in PR #21259 (cited above). No release data is tracked. Verify downstream.
- Fix last verified (merged) `2026-05-07`.
- Subsystem: `environments`
