Skip to content

Commit 30765cf

Browse files
committed
code_review: PR sourcegit-scm#495
* correct the path passed to `--cwd`
1 parent e011b18 commit 30765cf

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/Native/Linux.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,15 @@ public void OpenInFileManager(string path, bool select)
6666

6767
public void OpenTerminal(string workdir)
6868
{
69-
var startInfo = new ProcessStartInfo();
7069
var home = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
71-
startInfo.WorkingDirectory = string.IsNullOrEmpty(workdir) ? home : workdir;
70+
var cwd = string.IsNullOrEmpty(workdir) ? home : workdir;
71+
72+
var startInfo = new ProcessStartInfo();
73+
startInfo.WorkingDirectory = cwd;
7274
startInfo.FileName = OS.ShellOrTerminal;
7375

7476
if (OS.ShellOrTerminal.EndsWith("wezterm", StringComparison.OrdinalIgnoreCase))
75-
startInfo.Arguments = $"start --cwd \"{workdir}\"";
77+
startInfo.Arguments = $"start --cwd \"{cwd}\"";
7678

7779
try
7880
{

0 commit comments

Comments
 (0)