From 7f0caf06833130727b238a2afeb58f3b5096a34c Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Wed, 17 Jan 2018 08:02:50 -0500 Subject: [PATCH] Update Windows default command to print relative paths (#1200) --- src/constants.go | 2 +- src/util/util_windows.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/constants.go b/src/constants.go index 0629d05..f303384 100644 --- a/src/constants.go +++ b/src/constants.go @@ -59,7 +59,7 @@ func init() { } else if os.Getenv("TERM") == "cygwin" { defaultCommand = `sh -c "command find -L . -mindepth 1 -path '*/\.*' -prune -o -type f -print -o -type l -print 2> /dev/null | cut -b3-"` } else { - defaultCommand = `dir /s/b` + defaultCommand = `for /r %P in (*) do @(set "_curfile=%P" & set "_curfile=!_curfile:%__CD__%=!" & echo !_curfile!)` } } diff --git a/src/util/util_windows.go b/src/util/util_windows.go index 67b7031..41a9a5c 100644 --- a/src/util/util_windows.go +++ b/src/util/util_windows.go @@ -20,7 +20,7 @@ func ExecCommandWith(_shell string, command string) *exec.Cmd { cmd := exec.Command("cmd") cmd.SysProcAttr = &syscall.SysProcAttr{ HideWindow: false, - CmdLine: fmt.Sprintf(` /s /c "%s"`, command), + CmdLine: fmt.Sprintf(` /v:on/s/c "%s"`, command), CreationFlags: 0, } return cmd