Repository: jesseduffield/lazygit (language: go)

Issue:
Feature: use repo name as application (window) title?
**Is your feature request related to a problem? Please describe.**
Each of the applications in my taskbar has a title. For instance an instance of Firefox has the same title as the webpage that is currently open. So I have the icon to know that it's Firefox and I have the text that shows me that the loaded webpage is Github. This is useful, because sometimes you have multiple instance of an application opened and you need to distinguish them from one another. The lazygit application does not have a "title". The text by the icon is the path to the lazygit executable.

**Describe the solution you'd like**
I would like the lazygit application in my taskbar to display the name of the currently open repo.

**Describe alternatives you've considered**
None.

**Additional context**
I'm on Windows 10.
![image](https://user-images.githubusercontent.com/5260237/149911298-0d12ca65-72a5-4816-9064-80700b1008a7.png)


Discussion / hints:
I'm on a mac so I'm not very across how this would work in windows. Happy to accept a PR though :)
Never touched golang before but I'll do my best

lazygit is a masterpiece btw
you're too kind! Let me know if you need any guidance
So this is a way to set the title for the application. Works in cmd and PowerShell terminals.

```
cmdTitleSet := exec.Command("cmd", "/C", "title", "your_title_here")
errTitleSet := cmdTitleSet.Run()
if errTitleSet != nil {
	fmt.Println(errTitleSet.Error())
}
```

Next steps is to figure out
a) Where it is appropriate to put this code
b) How to obtain the "repo name" to use as title

Fix patch:
diff --git a/pkg/commands/oscommands/os.go b/pkg/commands/oscommands/os.go
index b328345e9e1..53f5bd6f66e 100644
--- a/pkg/commands/oscommands/os.go
+++ b/pkg/commands/oscommands/os.go
@@ -267,3 +267,15 @@ func GetLazygitPath() string {
 	}
 	return `"` + filepath.ToSlash(ex) + `"`
 }
+
+func (c *OSCommand) UpdateWindowTitle() error {
+	if c.Platform.OS != "windows" {
+		return nil
+	}
+	path, getWdErr := os.Getwd()
+	if getWdErr != nil {
+		return getWdErr
+	}
+	argString := fmt.Sprint("title ", filepath.Base(path), " - Lazygit")
+	return c.Cmd.NewShell(argString).Run()
+}
diff --git a/pkg/gui/gui.go b/pkg/gui/gui.go
index 4d11efcc56d..50291c8bf8d 100644
--- a/pkg/gui/gui.go
+++ b/pkg/gui/gui.go
@@ -683,6 +683,10 @@ func (gui *Gui) loadNewRepo() error {
 		return err
 	}
 
+	if err := gui.OSCommand.UpdateWindowTitle(); err != nil {
+		return err
+	}
+
 	return nil
 }
 


Test patch: