Skip to content

Commit 9627206

Browse files
committed
fix: launch terminal in current user's home dir failed on macOS(#105)
1 parent 7da184c commit 9627206

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Native/MacOS.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,12 @@ public void OpenInFileManager(string path, bool select)
6565
public void OpenTerminal(string workdir)
6666
{
6767
var dir = string.IsNullOrEmpty(workdir) ? "~" : workdir;
68+
dir = dir.Replace(" ", "\\ ");
69+
6870
var builder = new StringBuilder();
6971
builder.AppendLine("on run argv");
7072
builder.AppendLine(" tell application \"Terminal\"");
71-
builder.AppendLine($" do script \"cd '{dir}'\"");
73+
builder.AppendLine($" do script \"cd {dir}\"");
7274
builder.AppendLine(" activate");
7375
builder.AppendLine(" end tell");
7476
builder.AppendLine("end run");

0 commit comments

Comments
 (0)