diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index fef8174eb..7c5a34c4f 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -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 diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e2ae070b..c4af91e4b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,7 @@ All notable changes to this project will be documented in this file. - [CLI] Make `ckan compat add` take multiple versions, add `clear` and `set` (#4151 by: HebaruSan) - [GUI] Add mod support links to Help menu (#4154 by: HebaruSan) - [GUI] Don't hide other providing mods for installed, make installed bold (#4163 by: HebaruSan) +- [CLI] Set headless mode automatically (#4166 by: HebaruSan) ### Bugfixes diff --git a/Cmdline/Options.cs b/Cmdline/Options.cs index 86e459357..53080fb09 100644 --- a/Cmdline/Options.cs +++ b/Cmdline/Options.cs @@ -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) {