Skip to content

Add optional process name configuration for improved game stopping#19

Merged
pardeike merged 2 commits intomainfrom
copilot/fix-18
Sep 14, 2025
Merged

Add optional process name configuration for improved game stopping#19
pardeike merged 2 commits intomainfrom
copilot/fix-18

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Sep 14, 2025

This PR addresses the suboptimal game stopping mechanism by adding support for an optional stopProcessName configuration field that enables more reliable game termination, particularly for Steam/Epic launcher games.

Problem

Previously, GABS could only stop the processes it directly launched. For Steam/Epic games, this meant only the launcher process could be stopped, not the actual game process that runs independently. This left games running even after calling games.stop or games.kill.

Solution

Added an optional stopProcessName field to game configurations that allows users to specify the actual process name to terminate:

{
  "rimworld": {
    "launchMode": "SteamAppId", 
    "target": "294100",
    "stopProcessName": "RimWorldWin64.exe"
  },
  "minecraft": {
    "launchMode": "DirectPath",
    "target": "/opt/minecraft/start.sh", 
    "stopProcessName": "java"
  }
}

Implementation Details

  • Cross-platform process finding: Uses tasklist on Windows, ps on macOS/Linux
  • Graceful fallback: If process name stopping fails, falls back to original process stopping
  • Both stop modes: Works with both games.stop (graceful) and games.kill (force)
  • CLI integration: Interactive game setup now prompts for optional stop process name
  • Backward compatibility: Existing configurations continue working without changes

Platform Support

Platform Process Discovery Process Termination
Windows tasklist /FO CSV taskkill [/F] /PID
macOS ps axo pid,comm kill [-9] <pid>
Linux ps axo pid,comm kill [-9] <pid>

The implementation handles platform-specific executable naming (e.g., adding .exe on Windows) and supports both exact matches and partial name matching for flexibility.

Fixes #18.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: pardeike <853584+pardeike@users.noreply.github.com>
Copilot AI changed the title [WIP] Improve stopping Add optional process name configuration for improved game stopping Sep 14, 2025
Copilot AI requested a review from pardeike September 14, 2025 08:08
@pardeike pardeike marked this pull request as ready for review September 14, 2025 08:09
@pardeike pardeike merged commit 37f303e into main Sep 14, 2025
2 checks passed
@pardeike pardeike deleted the copilot/fix-18 branch September 14, 2025 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve stopping

2 participants