Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set headless mode automatically #4166

Merged
merged 2 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ jobs:
env:
REPO_ACCESS_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
if: env.REPO_ACCESS_TOKEN
uses: peter-evans/repository-dispatch@v2
uses: peter-evans/repository-dispatch@v3
with:
repository: KSP-CKAN/CKAN-ModInstaller
event-type: deploy
Expand Down
12 changes: 12 additions & 0 deletions Cmdline/Options.cs
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,18 @@ public virtual int Handle(GameInstanceManager manager, IUser user)
log.Info("Verbose logging enabled");
}

// Auto-detect whether IO device is interactive
if (!Headless && (Console.IsInputRedirected || Console.IsOutputRedirected))
{
log.InfoFormat("Setting headless mode ({0})",
Console.IsInputRedirected
? Console.IsOutputRedirected
? "I/O redirected"
: "input redirected"
: "output redirected");
Headless = true;
}

// Assign user-agent string if user has given us one
if (NetUserAgent != null)
{
Expand Down