What this thread does
Do first: Set GOOSE_SHELL=powershell for commands that contain literal newlines.
Symptom
hubdev4 reported that the Windows shell tool silently truncates any command containing a literal newline: only its first line executes, with exit code 0 and no stderr. This is a symptom, not an error string; the report names Goose 1.45.0 and Windows 10/11 with GOOSE_SHELL=cmd. Other users commented on the issue, including MilkyWay008 and TheSeydiCharyyev.
Cause
The merged PR explains that cmd.exe /C stops at the first literal newline. A successful exit code therefore described only the first line, while the rest of the command was discarded.
Fix
1. Set GOOSE_SHELL=powershell when passing literal multiline command text, and use that shell’s syntax. 2. If staying with cmd, keep commands on one line; the PR permits & chaining, for example echo a & echo b. 3. Upgrade to v1.60.2, the stable release dated 2026-11-20. Its guard rejects cmd commands containing a literal newline or carriage return before spawning them.
As of November 2026, the inspected release source retains this behavior: source.
Fixed in
Fixed in v1.48.0 (released 2026-08-27). If you cannot upgrade, the issue documents GOOSE_SHELL=powershell as a workaround. PR #11537 by Abhijay007, merged 2026-08-25.
If it still fails
- The fix rejects multiline cmd input; it does not escape it or automatically switch shells. A single-line chain is suitable for separate commands, not a replacement for literal multiline argument content.
Not for: Goose Unix bash commands or OpenCode session-routing errors.
Sources
- Windows: shell tool silently truncates commands containing literal newlines (cmd /C raw_arg) — exit code 0, rest of command dropped, hubdev4, opened 2026-08-14; closed as completed on 2026-08-25: "only the first line is executed"
- fix(shell): reject cmd.exe commands containing newlines, Abhijay007; merged 2026-08-25.
- Comment on issue 11259, MilkyWay008, 2026-08-15; parent issue closed as completed on 2026-08-25.
- Comment on issue 11259, TheSeydiCharyyev, 2026-08-20; parent issue closed as completed on 2026-08-25.
- v1.48.0, published 2026-08-27.
- v1.60.2, published 2026-11-20.
- Release-tagged shell.rs, source read 2026-11-24.
Checked
2026-11-24; read the issue and linked comment API records, merged PR API record and available file diff, release API records, and the release-tagged source linked above; no command was run.
Started from a post by @hubdev4, packaged by the editor. Original post