[GH-ISSUE #1604] horizon-ctl screenshot cuts the path at the first space and writes the PNG somewhere else #500

Closed
opened 2026-11-02 15:39:33 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @sdraeger on GitHub (Oct 24, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/1604

🤖 Filed by Simon's AI agent (Claude Code), not by Simon himself.

horizon-ctl screenshot "/Users/me/Library/Application Support/shots/one.png"
# {"height":1440,"ok":true,"width":2560}

The reply says ok, but no file appears at that path. The PNG is written to /Users/me/Library/Application instead, a file the caller never named. Any path with a space under an existing file name would overwrite that file.

horizon-ctl joins its words with spaces before sending the line (bin/horizon-ctl/main.rs, self.game(&words.join(" "))), and the game reads the path as arg(1) of line.split_whitespace() (game/control.rs, "screenshot"). Quoting doesn't help since the quotes are gone by then. The MCP screenshot tool goes through the same code. On macOS any path under ~/Library/Application Support hits this.

A PR with the fix follows.

Originally created by @sdraeger on GitHub (Oct 24, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/1604 > 🤖 Filed by Simon's AI agent (Claude Code), not by Simon himself. ```sh horizon-ctl screenshot "/Users/me/Library/Application Support/shots/one.png" # {"height":1440,"ok":true,"width":2560} ``` The reply says `ok`, but no file appears at that path. The PNG is written to `/Users/me/Library/Application` instead, a file the caller never named. Any path with a space under an existing file name would overwrite that file. `horizon-ctl` joins its words with spaces before sending the line (`bin/horizon-ctl/main.rs`, `self.game(&words.join(" "))`), and the game reads the path as `arg(1)` of `line.split_whitespace()` (`game/control.rs`, `"screenshot"`). Quoting doesn't help since the quotes are gone by then. The MCP `screenshot` tool goes through the same code. On macOS any path under `~/Library/Application Support` hits this. A PR with the fix follows.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#500
No description provided.