Repository: jesseduffield/lazygit (language: go)

Issue:
Add `theme.defaultFgColor`
**Is your feature request related to a problem? Please describe.**

#2257 switched to using the default terminal color instead of pre-defined colors for light/dark mode. The issue is that some terminal themes, like mine, don't lend themselves well to this theming.

**Describe the solution you'd like**

Add and use a new `theme.defaultFgColor` setting to allow us to override the default theming.

**Describe alternatives you've considered**

Not having this setting is technically possible, but it doesn't look nearly as good.

**Additional context**

Can't add screenshots, unfortunately, but trust me, it looks bad. If you have a mac try setting your terminal theme to 'homebrew' then use lazygit.


Discussion / hints:
> Can't add screenshots, unfortunately, but trust me, it looks bad

😆 

As discussed, the `theme.defaultFgColor` is a good approach. This is a super-simple issue. Here's what needs doing:
1. In `pkg/theme/theme.go:61` we want to go:
```go
DefaultTextColor = GetTextStyle(themeConfig.DefaultFgColor, false)
GocuiDefaultTextColor = GetGocuiStyle(themeConfig.DefaultFgColor)
```

2. Then we just need to actually have `DefaultFgColor` defined on our theme config which you can add in `pkg/config/user_config.go:56`. 

3. Then in the same file at line `pkg/config/user_config.go:359` we want to give that field a default of `[]string{"default"}`

4. Then in `docs/Config.md:31` we need to add that default value there too

I've chucked a good-first-issue on this ticket and if you take a look [here](https://github.com/jesseduffield/lazygit/blob/master/CONTRIBUTING.md#running-in-a-github-codespace) you'll see how to spin up a codespace to add this feature from within your browser!

Would you be keen to give this a go @simon-abbott ?
I'd be happy to, assuming I can find the time in my day to work on it!
Hi @jesseduffield, I would enjoy to work on a first issue on lazygit. Can I work on this one or is this only assigned for OP ?

Fix patch:
diff --git a/docs/Config.md b/docs/Config.md
index aa5ceaaf9f0..691f791f5eb 100644
--- a/docs/Config.md
+++ b/docs/Config.md
@@ -46,6 +46,8 @@ gui:
       - blue
     unstagedChangesColor:
       - red
+    defaultFgColor:
+      - default
   commitLength:
     show: true
   mouseEvents: true
diff --git a/pkg/config/user_config.go b/pkg/config/user_config.go
index c31c74fe01f..52d034f4383 100644
--- a/pkg/config/user_config.go
+++ b/pkg/config/user_config.go
@@ -63,6 +63,7 @@ type ThemeConfig struct {
 	CherryPickedCommitBgColor []string `yaml:"cherryPickedCommitBgColor"`
 	CherryPickedCommitFgColor []string `yaml:"cherryPickedCommitFgColor"`
 	UnstagedChangesColor      []string `yaml:"unstagedChangesColor"`
+	DefaultFgColor            []string `yaml:"defaultFgColor"`
 }
 
 type CommitLengthConfig struct {
@@ -365,6 +366,7 @@ func GetDefaultConfig() *UserConfig {
 				CherryPickedCommitBgColor: []string{"cyan"},
 				CherryPickedCommitFgColor: []string{"blue"},
 				UnstagedChangesColor:      []string{"red"},
+				DefaultFgColor:            []string{"default"},
 			},
 			CommitLength:             CommitLengthConfig{Show: true},
 			SkipNoStagedFilesWarning: false,
diff --git a/pkg/theme/theme.go b/pkg/theme/theme.go
index 0970e08b788..62df8b50d0f 100644
--- a/pkg/theme/theme.go
+++ b/pkg/theme/theme.go
@@ -58,6 +58,6 @@ func UpdateTheme(themeConfig config.ThemeConfig) {
 	OptionsColor = GetGocuiStyle(themeConfig.OptionsTextColor)
 	OptionsFgColor = GetTextStyle(themeConfig.OptionsTextColor, false)
 
-	DefaultTextColor = style.FgDefault
-	GocuiDefaultTextColor = gocui.ColorDefault
+	DefaultTextColor = GetTextStyle(themeConfig.DefaultFgColor, false)
+	GocuiDefaultTextColor = GetGocuiStyle(themeConfig.DefaultFgColor)
 }


Test patch: