mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-06 23:46:13 +02:00
invoke title-setting shell command appropriately
This commit is contained in:
parent
555d8bbc96
commit
62a7d9bbcc
@ -269,7 +269,7 @@ func GetLazygitPath() string {
|
|||||||
return `"` + filepath.ToSlash(ex) + `"`
|
return `"` + filepath.ToSlash(ex) + `"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func UpdateWindowTitle() error {
|
func (c *OSCommand) UpdateWindowTitle() error {
|
||||||
if runtime.GOOS != "windows" {
|
if runtime.GOOS != "windows" {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@ -278,10 +278,6 @@ func UpdateWindowTitle() error {
|
|||||||
return getWdErr
|
return getWdErr
|
||||||
}
|
}
|
||||||
title := fmt.Sprint(filepath.Base(path), " - Lazygit")
|
title := fmt.Sprint(filepath.Base(path), " - Lazygit")
|
||||||
args := append([]string{"/C", "title"}, strings.Split(title, " ")...)
|
args := append([]string{"cmd", "/C", "title"}, strings.Split(title, " ")...)
|
||||||
cmd := exec.Command("cmd", args...)
|
return c.Cmd.NewShell(strings.Join(args, " ")).Run()
|
||||||
if err := cmd.Run(); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
@ -683,7 +683,7 @@ func (gui *Gui) loadNewRepo() error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
oscommands.UpdateWindowTitle()
|
gui.OSCommand.UpdateWindowTitle()
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user