[BUG] -c: line 1: unexpected EOF while looking for matching `''

Resolved 💬 15 comments Opened Feb 19, 2026 by seanoAvani Closed Apr 23, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Hi,

None of the bash commands are working in the latest version 2.1.47, my user folder on windows contains a ' and this is not being escaped correctly. C:\Users\SeanO'Loughlin

● Bash(cd "S:/project" && dotnet test --no-restore 2>&1 | tail -100)
  ⎿  Error: Exit code 2
     /usr/bin/bash: -c: line 1: unexpected EOF while looking for matching `''

     /usr/bin/bash: -c: line 1: unexpected EOF while looking for matching `''

What Should Happen?

The bash commands should work.

Error Messages/Logs

● Bash(cd "S:/project" && dotnet test --no-restore 2>&1 | tail -100)
  ⎿  Error: Exit code 2
     /usr/bin/bash: -c: line 1: unexpected EOF while looking for matching `''

     /usr/bin/bash: -c: line 1: unexpected EOF while looking for matching `''

● Bash(cd S:/project && dotnet test --no-restore 2>&1 | tail -100)
  ⎿  Error: Exit code 2
     /usr/bin/bash: -c: line 1: unexpected EOF while looking for matching `''

     /usr/bin/bash: -c: line 1: unexpected EOF while looking for matching `''

● Bash(cd /s/project && dotnet test --no-restore 2>&1 | tail -100)
  ⎿  Error: Exit code 2
     /usr/bin/bash: -c: line 1: unexpected EOF while looking for matching `''

     /usr/bin/bash: -c: line 1: unexpected EOF while looking for matching `''

● Bash(dotnet test S:/project --no-restore 2>&1)
  ⎿  Error: Exit code 2
     /usr/bin/bash: -c: line 1: unexpected EOF while looking for matching `''

     /usr/bin/bash: -c: line 1: unexpected EOF while looking for matching `''

● The path with the apostrophe in the username is causing issues. Let me work around it.

● Bash(cd /s/project && dotnet test 2>&1)
  ⎿  Error: Exit code 2
     /usr/bin/bash: -c: line 1: unexpected EOF while looking for matching `''

     /usr/bin/bash: -c: line 1: unexpected EOF while looking for matching `''

● Bash(pushd /s/project && pwd)
  ⎿  Error: Exit code 2
     /usr/bin/bash: -c: line 1: unexpected EOF while looking for matching `''

     /usr/bin/bash: -c: line 1: unexpected EOF while looking for matching `''

● Bash(pwd)
  ⎿  Error: Exit code 2
     /usr/bin/bash: -c: line 1: unexpected EOF while looking for matching `''

     /usr/bin/bash: -c: line 1: unexpected EOF while looking for matching `''

● Bash(echo hello)
  ⎿  Error: Exit code 2
     /usr/bin/bash: -c: line 1: unexpected EOF while looking for matching `''

     /usr/bin/bash: -c: line 1: unexpected EOF while looking for matching `''

● Bash(echo "hello world")
  ⎿  Error: Exit code 2
     /usr/bin/bash: -c: line 1: unexpected EOF while looking for matching `''

     /usr/bin/bash: -c: line 1: unexpected EOF while looking for matching `''

Steps to Reproduce

Have a ' in your users folder name on Windows.
Install version 2.1.47 and ask claude to ls

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

2.1.45

Claude Code Version

2.1.47

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Windows Terminal

Additional Information

_No response_

View original on GitHub ↗

This issue has 15 comments on GitHub. Read the full discussion on GitHub ↗