Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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: 2 additions & 0 deletions MCPForUnity/Editor/Constants/EditorPrefKeys.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,7 @@ internal static class EditorPrefKeys
internal const string LogRecordEnabled = "MCPForUnity.LogRecordEnabled";

internal const string ExecuteCodeCompiler = "MCPForUnity.ExecuteCode.Compiler";

internal const string MacOSTerminalApp = "MCPForUnity.MacOSTerminalApp";
}
}
6 changes: 5 additions & 1 deletion MCPForUnity/Editor/Services/Server/TerminalLauncher.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using System;
using System.IO;
using MCPForUnity.Editor.Constants;
using MCPForUnity.Editor.Helpers;
using UnityEditor;
using UnityEngine;

namespace MCPForUnity.Editor.Services.Server
Expand Down Expand Up @@ -45,10 +47,12 @@ public System.Diagnostics.ProcessStartInfo CreateTerminalProcessStartInfo(string
"clear\n" +
$"{command}\n");
ExecPath.TryRun("/bin/chmod", $"+x \"{scriptPath}\"", Application.dataPath, out _, out _, 3000);
string terminalApp = EditorPrefs.GetString(EditorPrefKeys.MacOSTerminalApp, "Terminal");
if (string.IsNullOrWhiteSpace(terminalApp)) terminalApp = "Terminal";
return new System.Diagnostics.ProcessStartInfo
{
FileName = "/usr/bin/open",
Arguments = $"-a Terminal \"{scriptPath}\"",
Arguments = $"-a \"{terminalApp}\" \"{scriptPath}\"",
UseShellExecute = false,
CreateNoWindow = true
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ public class EditorPrefsWindow : EditorWindow
{ EditorPrefKeys.LastLocalHttpServerPidArgsHash, EditorPrefType.String },
{ EditorPrefKeys.LastLocalHttpServerPidFilePath, EditorPrefType.String },
{ EditorPrefKeys.LastLocalHttpServerInstanceToken, EditorPrefType.String },
{ EditorPrefKeys.MacOSTerminalApp, EditorPrefType.String },
};

// Templates
Expand Down