Windows terminal output and Git Bash execution issues

NousResearch/hermes-agent · cluster 14638 · environments

Data as of

Nothing open on GitHub. Fix merged in #21259. Check it covers your case.

The short answer

0open issues
0open PRs
7items grouped
Known?
Yes. 7 related items grouped here, 4 issues already closed.
Fix event
A fix was merged to main in PR #21259. Check it covers your case. No release data is tracked.
Tracker
The maintainers' tracker marks this partially resolved, deciding PR #21259. That is separate from the fix event.
Still open
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.

Open issues0

No open issues.

Open PRs0

No open pull requests.

Fixes on record

Merged to main. A stamp counts the issues a fix is linked to.

  • #21259 fix(windows): terminal drain + cwd path conversion (salvage #19258)

    merged to main

    files: tools/environments/base.py, tools/environments/local.py

    Show the diff
    • tools/environments/base.py
      @@ -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
      @@ -3,6 +3,7 @@
       import logging
       import os
       import platform
      +import re
       import shutil
       import signal
       import subprocess
      @@ -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,
      @@ -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:

2 PRs closed without merging

From the close comments: closed without comment 1 · superseded by another PR 1

  • #14644 fix(windows): native Git Bash terminal — exit 126 with empty output · superseded by another PR → #12795, #13397
  • #19258 fix(windows): terminal drain and cwd path conversion · closed without comment
Closed issues · 4
  • Closed#14638Windows: Terminal exits 126 with empty output on every command (Git Bash backend)
  • Closed#16425[Bug]: Windows local terminal commands can complete without returning any output
  • Closed#16426[Windows] Terminal tool returns empty output on native Windows
  • Closed#25514# [Windows] Terminal foreground commands return empty output (select.select() fails on pipe fds)
How this cluster was grouped
  • Link evidence (partly structural links): 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 item 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.

Pick up a Lab task

Check whether a fix covers the open issues here, with your own agent. Bring back evidence for maintainers.

Open the Lab

At a glance

Subsystem
environments
Merged PRs
#21259
Closed issues
4
Attempts
2 PRs closed without merging
Fix link checked
7 May 2026

For your agent

The same facts, typed.