fix: exit 0 on bare Windows launch instead of bailing

A bare launch of sigit.exe (TTY stdin, no arguments) falls through to the non-Unix interactive branch, which called anyhow::bail! and returned a non-zero exit code. winget's installer validator launches the installed executable with no arguments and treats a non-zero exit as a failure (Validation-Executable-Error, PR #446504). There is no TUI on non-Unix (the interactive client relies on Unix-only fd redirection), so a bare launch has nothing to do. Print a short usage message pointing at ACP and headless modes and exit Ok(()) (exit 0). Co-Authored-By: siGit Code v1.6.7-acp <noreply@sigit.si>

Seto Elkahfi committed Oct 11, 2026 at 20:23 UTC 9cd0aeb09307ca36c4c0fd5f4eb87242443bb767
1 file changed +20 -1
src/main.rs
+20 -1
@@ -6245,7 +6245,26 @@ async fn main() -> anyhow::Result<()> {
6245 }
6246 #[cfg(not(unix))]
6247 {
6248 - anyhow::bail!("interactive mode requires Unix (macOS / Linux)");
6248 + // No TUI on non-Unix: the interactive full-screen client relies on
6249 + // fd redirection that only exists on Unix. A bare launch in a
6250 + // terminal (the common case, and exactly what the winget installer
6251 + // validator does — run `sigit.exe` with no arguments) therefore has
6252 + // nothing to do, so print how to use the binary and exit cleanly.
6253 + // Bailing here instead would return a non-zero exit code, which the
6254 + // validator reads as a failure (Validation-Executable-Error).
6255 + println!(
6256 + "siGit Code v{}\n\n\
6257 + Interactive terminal mode is Unix-only (macOS / Linux). On this \
6258 + platform sigit runs as an ACP agent for editor integration, or \
6259 + non-interactively from a script:\n\n\
6260 + \x20 sigit run \"<prompt>\" run one prompt and exit\n\
6261 + \x20 sigit --version print the version\n\
6262 + \x20 sigit login sign in to siGit Code Cloud\n\n\
6263 + Point your editor's ACP client at this binary to use it \
6264 + interactively.",
6265 + env!("CARGO_PKG_VERSION")
6266 + );
6267 + Ok(())
6268 }
6269 } else {
6270 // ACP mode: keep stdout untouched for protocol JSON only.