diff --git a/scripts/start.ps1 b/scripts/start.ps1 index 05463a6a..f2db5613 100644 --- a/scripts/start.ps1 +++ b/scripts/start.ps1 @@ -39,7 +39,15 @@ param ( "-NoProfile", # Don't load PowerShell profile "-File", $MyInvocation.MyCommand.Source, # Script path $args | ForEach-Object { $_ } # Script arguments - ) | ForEach-Object { "`"$_`"" } + ) + + if ($Debug) { + $PwshArgList = @( + "-NoExit" # Don't exit after running the command + ) + $PwshArgList + } + + $PwshArgList = $PwshArgList | ForEach-Object { "`"$_`"" } $WorkingDirectory = Get-Location @@ -51,6 +59,17 @@ param ( PassThru = $true; } + # Use 'wt' if available + if (Get-Command "wt" -ErrorAction SilentlyContinue) { + $WtArgList = @( + "new-tab", + $ProcessParameters.FilePath + ) + $PwshArgList + + $ProcessParameters.FilePath = "wt.exe" + $ProcessParameters.ArgumentList = $WtArgList + } + $process = $null try { $process = Start-Process @ProcessParameters