From a910222e2b0b63d102cbdad4410193c4190e41e4 Mon Sep 17 00:00:00 2001 From: Kashish Sahu <125540624+gitKashish@users.noreply.github.com> Date: Sun, 2 Aug 2026 19:12:17 +0530 Subject: [PATCH] fix(ttyd): explicitly define the cwd during ttyd startup to bypass invalid path bug on windows --- tty.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tty.go b/tty.go index c8af5dea..77dc79fc 100644 --- a/tty.go +++ b/tty.go @@ -14,6 +14,7 @@ import ( "net" "os" "os/exec" + "runtime" ) // randomPort returns a random port number that is not in use. @@ -36,6 +37,10 @@ func buildTtyCmd(port int, shell Shell) *exec.Cmd { "--writable", } + if runtime.GOOS == "windows" { + args = append(args, "-w", ".") + } + args = append(args, shell.Command...) cmd := exec.Command("ttyd", args...)