From 9e5bd30102232a743a0f90ee7c33b73cea79feaf Mon Sep 17 00:00:00 2001 From: David Gu Date: Fri, 28 Aug 2026 14:12:49 -0700 Subject: [PATCH] fix(droid-control): support tctl on Windows Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com> --- plugins/droid-control/bin/tctl | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/plugins/droid-control/bin/tctl b/plugins/droid-control/bin/tctl index da7de2f..fb88c39 100755 --- a/plugins/droid-control/bin/tctl +++ b/plugins/droid-control/bin/tctl @@ -584,6 +584,20 @@ launch_tuistory() { cleanup_tuistory_asciinema "$session" "$record_path" launch_cmd="$(write_tuistory_recording_runner "$session" "$record_path")" fi + # On Windows, passing a .sh file directly makes CreateProcess follow the + # file association and open Git Bash/Mintty outside Tuistory's PTY. Launch + # the runner through bash.exe instead. Tuistory's Windows command parser + # does not preserve quoted executable paths, so use DOS short paths to keep + # both argv entries whitespace-free. + case "$(uname -s)" in + MINGW*|MSYS*|CYGWIN*) + require_cmd cygpath + local bash_win runner_win + bash_win="$(cygpath -w -s "$(command -v bash)")" + runner_win="$(cygpath -w -s "$launch_cmd")" + launch_cmd="$bash_win $runner_win" + ;; + esac local args=(launch "$launch_cmd" -s "$session" --cols "$cols" --rows "$rows") tuistory "${args[@]}" }