[PR #719] [MERGED] Launcher: custom arguments for the game's command line #2754

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/719
Author: @rdbtCVS
Created: 10/17/2026
Status: ✅ Merged
Merged: 10/17/2026
Merged by: @ludovic111

Base: main ← Head: feat/launcher-game-arguments


📝 Commits (1)

  • dd77fb8 Launcher: custom arguments for the game's command line

📊 Changes

5 files changed (+290 additions, -10 deletions)

View changed files

📝 launcher/README.md (+10 -3)
📝 launcher/src/backend.rs (+113 -0)
📝 launcher/src/cli.rs (+73 -1)
📝 launcher/src/main.rs (+89 -5)
📝 launcher/src/mcp.rs (+5 -1)

📄 Description

What and why

Fixes #716.

The launcher had no way to pass arguments to the game. Settings now has a Game arguments field (one line, quotes group a word with spaces), kept as game_args in settings.json and appended to the client's command line after the launcher's own. So a player can pass --server-thread, --render-distance 40, and so on.

The same line is available everywhere the launcher starts the game:

  • horizon-launcher game-args [<line>] shows or sets it (--json included).
  • horizon-launcher play --arg <ARG> passes one argument for a single run (repeatable; --arg --server-thread works).
  • The MCP launch_client tool takes an args array.

backend::split_args turns the line into words (spaces separate, '…'/"…" group, \ escapes), the same splitter feeding all three, with unit tests for the quoting.

Vanilla reference

"Horizon-only" for the launcher UI, CLI and MCP; the arguments themselves are the game's own. --server-thread is parsed in crates/horizon-client/src/game.rs. No harness.

Self-check

pr_ready: 5 files changed since origin/main; checks on local
  Public tree...
  Public tree: pass (0 s)
  launcher rustfmt...
  launcher rustfmt: fail (0 s)
  launcher clippy...
  launcher clippy: pass (1 s)
  launcher tests...
  launcher tests: pass (3 s)
**pr_ready** (`tools/pr_ready.py --quick` on archlinux, against origin/main at 7bbbf6e97, 4 s)

| Check | Result |
| --- | --- |
| Scope | ✅ 5 files, +290 −10 |
| Cargo.lock | ✅ unchanged |
| Public tree | ✅ |
| Python tests | ➖ no Python change |
| rustfmt | ➖ no Rust change |
| clippy | ➖ no Rust change |
| tests | ➖ no crate touched |
| tokens.css up to date | ➖ theme untouched |
| launcher rustfmt | ❌ failed |
| launcher clippy | ✅ (1 s) |
| launcher tests | ✅ 55 passed (3 s) |
| Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses |
| Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) |

The launcher rustfmt line fails only on two files this PR does not touch: launcher/src/modpacks.rs:241 and launcher/src/sources_tests.rs:319. Those asserts are not rustfmt-clean on origin/main with the rustfmt installed here (1.85, 1.95 and 1.99 all want them expanded); I left them unchanged to keep the diff focused. This PR's own files are rustfmt-clean.

Screenshots

Settings gains one row, Game arguments, with a text field like the existing "Join a friend" field (placeholder For example --server-thread, saved to settings.json as you type). I could not capture a screenshot here: this machine is headless and the launcher window needs a display.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/719 **Author:** [@rdbtCVS](https://github.com/rdbtCVS) **Created:** 10/17/2026 **Status:** ✅ Merged **Merged:** 10/17/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/launcher-game-arguments` --- ### 📝 Commits (1) - [`dd77fb8`](https://github.com/horizon-rust/horizon/commit/dd77fb8016a5c088c274b0cc486a2b4383edfe9b) Launcher: custom arguments for the game's command line ### 📊 Changes **5 files changed** (+290 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `launcher/README.md` (+10 -3) 📝 `launcher/src/backend.rs` (+113 -0) 📝 `launcher/src/cli.rs` (+73 -1) 📝 `launcher/src/main.rs` (+89 -5) 📝 `launcher/src/mcp.rs` (+5 -1) </details> ### 📄 Description ## What and why Fixes #716. The launcher had no way to pass arguments to the game. Settings now has a **Game arguments** field (one line, quotes group a word with spaces), kept as `game_args` in `settings.json` and appended to the client's command line after the launcher's own. So a player can pass `--server-thread`, `--render-distance 40`, and so on. The same line is available everywhere the launcher starts the game: - `horizon-launcher game-args [<line>]` shows or sets it (`--json` included). - `horizon-launcher play --arg <ARG>` passes one argument for a single run (repeatable; `--arg --server-thread` works). - The MCP `launch_client` tool takes an `args` array. `backend::split_args` turns the line into words (spaces separate, `'…'`/`"…"` group, `\` escapes), the same splitter feeding all three, with unit tests for the quoting. ## Vanilla reference "Horizon-only" for the launcher UI, CLI and MCP; the arguments themselves are the game's own. `--server-thread` is parsed in `crates/horizon-client/src/game.rs`. No harness. ## Self-check ``` pr_ready: 5 files changed since origin/main; checks on local Public tree... Public tree: pass (0 s) launcher rustfmt... launcher rustfmt: fail (0 s) launcher clippy... launcher clippy: pass (1 s) launcher tests... launcher tests: pass (3 s) **pr_ready** (`tools/pr_ready.py --quick` on archlinux, against origin/main at 7bbbf6e97, 4 s) | Check | Result | | --- | --- | | Scope | ✅ 5 files, +290 −10 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ➖ no Python change | | rustfmt | ➖ no Rust change | | clippy | ➖ no Rust change | | tests | ➖ no crate touched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ❌ failed | | launcher clippy | ✅ (1 s) | | launcher tests | ✅ 55 passed (3 s) | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | ``` The `launcher rustfmt` line fails only on two files this PR does not touch: `launcher/src/modpacks.rs:241` and `launcher/src/sources_tests.rs:319`. Those asserts are not rustfmt-clean on `origin/main` with the rustfmt installed here (1.85, 1.95 and 1.99 all want them expanded); I left them unchanged to keep the diff focused. This PR's own files are rustfmt-clean. ## Screenshots Settings gains one row, **Game arguments**, with a text field like the existing "Join a friend" field (placeholder `For example --server-thread`, saved to `settings.json` as you type). I could not capture a screenshot here: this machine is headless and the launcher window needs a display. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 15:58:47 +07:00
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#2754
No description provided.