From e3e091251eedd957813b0747c469348b8735d73f Mon Sep 17 00:00:00 2001 From: Jake Rosado Date: Fri, 13 Oct 2023 15:20:07 -0400 Subject: [PATCH] Fix system file dialog not opening on *nix systems Built-in commands "show_game_files" and "show_data_files" now open system file dialogs for *nix based systems. The fix is system-agnostic and works on Windows as well. Resolves: #851 --- .../Framework/Commands/Other/ShowDataFilesCommand.cs | 7 ++++++- .../Framework/Commands/Other/ShowGameFilesCommand.cs | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Other/ShowDataFilesCommand.cs b/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Other/ShowDataFilesCommand.cs index a233d5881..714e54a5a 100644 --- a/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Other/ShowDataFilesCommand.cs +++ b/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Other/ShowDataFilesCommand.cs @@ -20,7 +20,12 @@ public ShowDataFilesCommand() /// The command arguments. public override void Handle(IMonitor monitor, string command, ArgumentParser args) { - Process.Start(Constants.DataPath); + Process.Start(new ProcessStartInfo + { + FileName = Constants.DataPath, + UseShellExecute = true + }); + monitor.Log($"OK, opening {Constants.DataPath}.", LogLevel.Info); } } diff --git a/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Other/ShowGameFilesCommand.cs b/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Other/ShowGameFilesCommand.cs index 745b821ba..74bdc0d44 100644 --- a/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Other/ShowGameFilesCommand.cs +++ b/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Other/ShowGameFilesCommand.cs @@ -20,7 +20,12 @@ public ShowGameFilesCommand() /// The command arguments. public override void Handle(IMonitor monitor, string command, ArgumentParser args) { - Process.Start(Constants.GamePath); + Process.Start(new ProcessStartInfo + { + FileName = Constants.GamePath, + UseShellExecute = true + }); + monitor.Log($"OK, opening {Constants.GamePath}.", LogLevel.Info); } }