@@ -6,6 +6,9 @@ import (
66 _ "embed"
77 "fmt"
88 "html/template"
9+ "os"
10+ "path/filepath"
11+ "runtime"
912 "strings"
1013 "time"
1114
@@ -289,7 +292,7 @@ func NewBashTool(permissions permission.Service, workingDir string, attribution
289292 if stdout == "" {
290293 return fantasy.WithResponseMetadata(fantasy.NewTextResponse(BashNoOutput), metadata), nil
291294 }
292− stdout += fmt.Sprintf("\n\n<cwd>%s</cwd>", currentWorkingDir)
295+ stdout += fmt.Sprintf("\n\n<cwd>%s</cwd>", normalizeWorkingDir(currentWorkingDir))
293296 return fantasy.WithResponseMetadata(fantasy.NewTextResponse(stdout), metadata), nil
294297 })
295298}
@@ -313,3 +316,15 @@ func countLines(s string) int {
313316 }
314317 return len(strings.Split(s, "\n"))
315318}
319+
320+func normalizeWorkingDir(path string) string {
321+ if runtime.GOOS == "windows" {
322+ cwd, err := os.Getwd()
323+ if err != nil {
324+ cwd = "C:"
325+ }
326+ path = strings.ReplaceAll(path, filepath.VolumeName(cwd), "")
327+ }
328+
329+ return filepath.ToSlash(path)
330+}