private void CreateConnection(string workingDirectory = null) { lock (_createLock) { if (workingDirectory == null) { _studio = IoC.Get <IStudio>(); workingDirectory = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile); var solution = _studio.CurrentSolution; if (solution != null) { if (solution?.StartupProject != null) { workingDirectory = solution.StartupProject.CurrentDirectory; } else { workingDirectory = solution.CurrentDirectory; } } } CloseConnection(); var args = new List <string>(); if (Platform.PlatformIdentifier == Platforms.PlatformID.MacOSX) { args.Add("-l"); } var shellExecutable = PlatformSupport.ResolveFullExecutablePath((Platform.PlatformIdentifier == Platforms.PlatformID.Win32NT ? "powershell" : "bash") + Platform.ExecutableExtension); if (shellExecutable != null) { var terminal = s_provider.Create(80, 32, workingDirectory, null, shellExecutable, args.ToArray()); Connection = new PsuedoTerminalConnection(terminal); TerminalVisible = true; Connection.Closed += Connection_Closed; } } }