From a78cbf48821e426cea93825254c9aec5e91e9eef Mon Sep 17 00:00:00 2001 From: Birger Skogeng Pedersen Date: Thu, 20 Jan 2022 08:36:07 +0100 Subject: [PATCH] remove redundant title-setting shell command args --- pkg/commands/oscommands/os.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pkg/commands/oscommands/os.go b/pkg/commands/oscommands/os.go index 5790d17dc..53f5bd6f6 100644 --- a/pkg/commands/oscommands/os.go +++ b/pkg/commands/oscommands/os.go @@ -6,7 +6,6 @@ import ( "os" "os/exec" "path/filepath" - "runtime" "strings" "sync" @@ -270,14 +269,13 @@ func GetLazygitPath() string { } func (c *OSCommand) UpdateWindowTitle() error { - if runtime.GOOS != "windows" { + if c.Platform.OS != "windows" { return nil } path, getWdErr := os.Getwd() if getWdErr != nil { return getWdErr } - title := fmt.Sprint(filepath.Base(path), " - Lazygit") - args := append([]string{"cmd", "/C", "title"}, strings.Split(title, " ")...) - return c.Cmd.NewShell(strings.Join(args, " ")).Run() + argString := fmt.Sprint("title ", filepath.Base(path), " - Lazygit") + return c.Cmd.NewShell(argString).Run() }