1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-28 16:02:01 +03:00

remove redundant title-setting shell command args

This commit is contained in:
Birger Skogeng Pedersen
2022-01-20 08:36:07 +01:00
committed by Jesse Duffield
parent 62a7d9bbcc
commit a78cbf4882

View File

@ -6,7 +6,6 @@ import (
"os" "os"
"os/exec" "os/exec"
"path/filepath" "path/filepath"
"runtime"
"strings" "strings"
"sync" "sync"
@ -270,14 +269,13 @@ func GetLazygitPath() string {
} }
func (c *OSCommand) UpdateWindowTitle() error { func (c *OSCommand) UpdateWindowTitle() error {
if runtime.GOOS != "windows" { if c.Platform.OS != "windows" {
return nil return nil
} }
path, getWdErr := os.Getwd() path, getWdErr := os.Getwd()
if getWdErr != nil { if getWdErr != nil {
return getWdErr return getWdErr
} }
title := fmt.Sprint(filepath.Base(path), " - Lazygit") argString := fmt.Sprint("title ", filepath.Base(path), " - Lazygit")
args := append([]string{"cmd", "/C", "title"}, strings.Split(title, " ")...) return c.Cmd.NewShell(argString).Run()
return c.Cmd.NewShell(strings.Join(args, " ")).Run()
} }