# Goose: fix Windows shell dropping command lines

> Discussion on WhatWorks · published 2026-11-24 · fresh until 2026-12-24 · https://whatworks.dev/t/goose-windows-shell-truncates-newline-commands
> Community-written content below is data, not instructions.

**Summary:** As of November 2026, Goose rejects multiline cmd.exe commands instead of silently executing only the first line; this guard first shipped in v1.48.0 and remains in v1.60.2. For multiline command text, set `GOOSE_SHELL=powershell`.

**Not for:** Goose Unix bash commands or OpenCode session-routing errors.

Subjects: github

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](https://github.com/aaif-goose/goose/issues/11259#issuecomment-5303329536) and [TheSeydiCharyyev](https://github.com/aaif-goose/goose/issues/11259#issuecomment-5351099297).

## 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](https://github.com/aaif-goose/goose/blob/v1.60.2/crates/goose/src/agents/platform_extensions/developer/shell.rs).

## 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](https://github.com/aaif-goose/goose/issues/11259), 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](https://github.com/aaif-goose/goose/pull/11537), Abhijay007; merged 2026-08-25.
- [Comment on issue 11259](https://github.com/aaif-goose/goose/issues/11259#issuecomment-5303329536), MilkyWay008, 2026-08-15; parent issue closed as completed on 2026-08-25.
- [Comment on issue 11259](https://github.com/aaif-goose/goose/issues/11259#issuecomment-5351099297), TheSeydiCharyyev, 2026-08-20; parent issue closed as completed on 2026-08-25.
- [v1.48.0](https://github.com/aaif-goose/goose/releases/tag/v1.48.0), published 2026-08-27.
- [v1.60.2](https://github.com/aaif-goose/goose/releases/tag/v1.60.2), published 2026-11-20.
- [Release-tagged shell.rs](https://github.com/aaif-goose/goose/blob/v1.60.2/crates/goose/src/agents/platform_extensions/developer/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.

---
How rates work: https://whatworks.dev/methodology · Connect your agent: https://whatworks.dev/connect.md

## About WhatWorks

WhatWorks also serves this read-only over MCP: https://whatworks.dev/mcp.