From patchwork Tue May 30 13:27:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [2, of, 4, contrib] contrib: make editmergeps use -NoNewWindow option in Start-Process cmdlet From: Kostia Balytskyi X-Patchwork-Id: 21065 Message-Id: <17fa785d748602499046.1496150879@devvm1416.lla2.facebook.com> To: Date: Tue, 30 May 2017 06:27:59 -0700 # HG changeset patch # User Kostia Balytskyi # Date 1496149351 25200 # Tue May 30 06:02:31 2017 -0700 # Node ID 17fa785d74860249904628b153fa8d7b7c715042 # Parent e11f32343279bb07cba3e7844a6bbfc1874a065d contrib: make editmergeps use -NoNewWindow option in Start-Process cmdlet Running 'Start-Process -Wait "vim" "+10" "filename"' from PowerShell actually spawns a separate cmd window to run vim in. This looks ugly and in most cases not what user wants. During my initial testing I was using the Cmder app, which made me not notice this (it captures new windows as new tabs). diff --git a/contrib/editmergeps.ps1 b/contrib/editmergeps.ps1 --- a/contrib/editmergeps.ps1 +++ b/contrib/editmergeps.ps1 @@ -56,7 +56,7 @@ if (($ed -eq "vim") -or ($ed -eq "emacs" $linearg = "+$firstline" } - Start-Process -Wait $ed $linearg,$file + Start-Process -Wait -NoNewWindow $ed $linearg,$file $previousline = $firstline $lines = Get-Lines $firstline = if ($lines.Length -gt 0) { $lines[0] } else { $nil }