hermes - 💡(How to fix) Fix Windows terminal: cd fails with 'No such file or directory' for Windows native paths

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

2026-05-31 00:54:10,673 WARNING agent.tool_executor: Tool terminal returned error: {"output": "/bin/bash: line 2: cd: C:\Users\liush: No such file or directory"}

Root Cause

On Windows, os.getcwd() returns native Windows paths (C:\Users\x). Hermes passes this to builtin cd in Git Bash. Git Bash's cd builtin may not understand Windows paths on some configurations, requiring POSIX form (/c/Users/x).

The existing _msys_to_windows_path() handles POSIX→Windows conversion, but the reverse (Windows→POSIX) for cd is missing.

Code Example

/bin/bash: line 2: cd: C:\\Users\\<user>: No such file or directory

---

2026-05-31 00:54:10,673 WARNING agent.tool_executor: Tool terminal returned error: 
  {"output": "/bin/bash: line 2: cd: C:\\Users\\liush: No such file or directory"}
RAW_BUFFERClick to expand / collapse

Bug Description

On Windows 11, every terminal tool call fails immediately with:

/bin/bash: line 2: cd: C:\\Users\\<user>: No such file or directory

This has been persistent since at least 2026-05-28. No terminal command works — the failure is at the cd step before the actual command runs.

Evidence from Logs

From ~/.hermes/logs/agent.log:

2026-05-31 00:54:10,673 WARNING agent.tool_executor: Tool terminal returned error: 
  {"output": "/bin/bash: line 2: cd: C:\\Users\\liush: No such file or directory"}

Same error also appears with paths like:

  • C:\Users\liush (Windows native)
  • C:\Users\liush\.hermes\hermes-agent (Windows native)
  • /c/Users/liush/.hermes/hermes-agent (POSIX — also fails)

Root Cause Analysis

On Windows, os.getcwd() returns native Windows paths (C:\Users\x). Hermes passes this to builtin cd in Git Bash. Git Bash's cd builtin may not understand Windows paths on some configurations, requiring POSIX form (/c/Users/x).

The existing _msys_to_windows_path() handles POSIX→Windows conversion, but the reverse (Windows→POSIX) for cd is missing.

Reproduction Difficulty

⚠️ Cannot reproduce on all setups. On some Git Bash installations, cd 'C:\Users\x' works fine. The failure appears to depend on:

  • Git for Windows version
  • MSYS2 pathconv settings
  • Possibly the MSYSTEM environment variable

Environment

  • OS: Windows 11
  • Git Bash: Git for Windows 2.x (system install)
  • Terminal backend: local
  • Hermes branch: main

Related

  • #23846 — cwd missing on disk warning on Windows (related but different — that issue's commands still work)
  • #18454 — Windows terminal exit code 126 (different root cause — missing Git Bash)

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix Windows terminal: cd fails with 'No such file or directory' for Windows native paths