From 596a4616b343bc527c0a90df0f0be0ece970c3c7 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Wed, 18 Aug 2021 23:38:23 -0400 Subject: no longer abort input thread when exiting `thread.Abort` is unimplemented in .NET 5, but it's not needed anyway since all threads will be aborted when the game exits. --- src/SMAPI/Framework/Logging/LogManager.cs | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/SMAPI/Framework/Logging/LogManager.cs') diff --git a/src/SMAPI/Framework/Logging/LogManager.cs b/src/SMAPI/Framework/Logging/LogManager.cs index a3d4f23d..7f1b76e7 100644 --- a/src/SMAPI/Framework/Logging/LogManager.cs +++ b/src/SMAPI/Framework/Logging/LogManager.cs @@ -162,8 +162,6 @@ namespace StardewModdingAPI.Framework.Logging // keep console thread alive while the game is running while (continueWhile()) Thread.Sleep(1000 / 10); - if (inputThread.ThreadState == ThreadState.Running) - inputThread.Abort(); } /// Show a 'press any key to exit' message, and exit when they press a key. -- cgit From 911843e1beb72a3fc0337a697f732215b66304c0 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Wed, 25 Aug 2021 18:26:02 -0400 Subject: fix console encoding issues (#798) --- docs/release-notes.md | 1 + src/SMAPI/Framework/Logging/LogManager.cs | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'src/SMAPI/Framework/Logging/LogManager.cs') diff --git a/docs/release-notes.md b/docs/release-notes.md index a00c73da..79129024 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -4,6 +4,7 @@ ## Upcoming release * For players: * Added friendly error in 64-bit mode when a mod is 32-bit only. + * Fixed console encoding issues on Linux/macOS. * Fixed some installer errors now show info header. * For mod authors: diff --git a/src/SMAPI/Framework/Logging/LogManager.cs b/src/SMAPI/Framework/Logging/LogManager.cs index 7f1b76e7..c6faa90d 100644 --- a/src/SMAPI/Framework/Logging/LogManager.cs +++ b/src/SMAPI/Framework/Logging/LogManager.cs @@ -109,9 +109,12 @@ namespace StardewModdingAPI.Framework.Logging output.OnMessageIntercepted += message => this.HandleConsoleMessage(this.MonitorForGame, message); Console.SetOut(output); - // enable Unicode handling + // enable Unicode handling on Windows + // (the terminal defaults to UTF-8 on Linux/macOS) +#if SMAPI_FOR_WINDOWS Console.InputEncoding = Encoding.Unicode; Console.OutputEncoding = Encoding.Unicode; +#endif } /// Get a monitor instance derived from SMAPI's current settings. -- cgit