Patchwork [2,of,4,contrib] contrib: make editmergeps use -NoNewWindow option in Start-Process cmdlet

login
register
mail settings
Submitter Kostia Balytskyi
Date May 30, 2017, 1:27 p.m.
Message ID <17fa785d748602499046.1496150879@devvm1416.lla2.facebook.com>
Download mbox | patch
Permalink /patch/21065/
State Accepted
Headers show

Comments

Kostia Balytskyi - May 30, 2017, 1:27 p.m.
# HG changeset patch
# User Kostia Balytskyi <ikostia@fb.com>
# 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).

Patch

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 }