mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-24 20:57:19 -08:00
fix: launch terminal in current user's home dir failed on macOS(#105)
This commit is contained in:
parent
7da184c55b
commit
9627206764
1 changed files with 3 additions and 1 deletions
|
@ -65,10 +65,12 @@ namespace SourceGit.Native
|
||||||
public void OpenTerminal(string workdir)
|
public void OpenTerminal(string workdir)
|
||||||
{
|
{
|
||||||
var dir = string.IsNullOrEmpty(workdir) ? "~" : workdir;
|
var dir = string.IsNullOrEmpty(workdir) ? "~" : workdir;
|
||||||
|
dir = dir.Replace(" ", "\\ ");
|
||||||
|
|
||||||
var builder = new StringBuilder();
|
var builder = new StringBuilder();
|
||||||
builder.AppendLine("on run argv");
|
builder.AppendLine("on run argv");
|
||||||
builder.AppendLine(" tell application \"Terminal\"");
|
builder.AppendLine(" tell application \"Terminal\"");
|
||||||
builder.AppendLine($" do script \"cd '{dir}'\"");
|
builder.AppendLine($" do script \"cd {dir}\"");
|
||||||
builder.AppendLine(" activate");
|
builder.AppendLine(" activate");
|
||||||
builder.AppendLine(" end tell");
|
builder.AppendLine(" end tell");
|
||||||
builder.AppendLine("end run");
|
builder.AppendLine("end run");
|
||||||
|
|
Loading…
Reference in a new issue