diff options
author | Birger Skogeng Pedersen <birger.sp@gmail.com> | 2022-01-19 12:29:40 +0100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2022-01-21 23:13:39 +1100 |
commit | 62a7d9bbcc5f43cee74468b18b36906c6b3ff1e1 (patch) | |
tree | de3f5f0892baa31aaa98ffa0d2c35e0dab738912 /pkg | |
parent | 555d8bbc96dcd2351e9c3d8ec3ed9d983adb0abc (diff) |
invoke title-setting shell command appropriately
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/commands/oscommands/os.go | 10 | ||||
-rw-r--r-- | pkg/gui/gui.go | 2 |
2 files changed, 4 insertions, 8 deletions
diff --git a/pkg/commands/oscommands/os.go b/pkg/commands/oscommands/os.go index 64d9edab8..5790d17dc 100644 --- a/pkg/commands/oscommands/os.go +++ b/pkg/commands/oscommands/os.go @@ -269,7 +269,7 @@ func GetLazygitPath() string { return `"` + filepath.ToSlash(ex) + `"` } -func UpdateWindowTitle() error { +func (c *OSCommand) UpdateWindowTitle() error { if runtime.GOOS != "windows" { return nil } @@ -278,10 +278,6 @@ func UpdateWindowTitle() error { return getWdErr } title := fmt.Sprint(filepath.Base(path), " - Lazygit") - args := append([]string{"/C", "title"}, strings.Split(title, " ")...) - cmd := exec.Command("cmd", args...) - if err := cmd.Run(); err != nil { - return err - } - return nil + args := append([]string{"cmd", "/C", "title"}, strings.Split(title, " ")...) + return c.Cmd.NewShell(strings.Join(args, " ")).Run() } diff --git a/pkg/gui/gui.go b/pkg/gui/gui.go index ffae386fc..6e3c4c955 100644 --- a/pkg/gui/gui.go +++ b/pkg/gui/gui.go @@ -683,7 +683,7 @@ func (gui *Gui) loadNewRepo() error { return err } - oscommands.UpdateWindowTitle() + gui.OSCommand.UpdateWindowTitle() return nil } |