Lazygit: Default colors don't work well with dark-on-light terminal color scheme

Created on 10 Sep 2019  路  16Comments  路  Source: jesseduffield/lazygit

Describe the bug
The default color theme is hard to read with a dark-on-light terminal theme (black text on gray background in my case, see screenshot).

To Reproduce
Steps to reproduce the behavior:

  1. On macOS Terminal, import and activate the attached theme configuration
  2. Launch lazygit

Expected behavior
More readable color choices on this background

Screenshots
Screenshots attached

Desktop (please complete the following information):

  • OS: [e.g. Windows] macOS
  • Lazygit Version [e.g. v0.1.45] 0.8.1

Additional context

Screen Shot 2019-09-10 at 1 53 33 PM

bug

Most helpful comment

This issue is now solved once the next release is out.
In the config file add these config settings and lazygit will work much better on a light theme.

  gui:
    theme:
      lightTheme: true
      activeBorderColor:
        - black
        - bold
      inactiveBorderColor:
        - black

If you used go get to install lazygit you can get the latest changes already using:
go get -u github.com/jesseduffield/lazygit
If you use go 1.13 and up add the @master to the url

All 16 comments

I can't attach the terminal theme file, so below it is in base64. Re-create the file by copying the dump and running:

pbpaste | base64 -d > ~/Desktop/DarkOnLight.terminal

PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPCFET0NUWVBFIHBsaXN0IFBVQkxJ
QyAiLS8vQXBwbGUvL0RURCBQTElTVCAxLjAvL0VOIiAiaHR0cDovL3d3dy5hcHBsZS5jb20vRFREcy9Q
cm9wZXJ0eUxpc3QtMS4wLmR0ZCI+CjxwbGlzdCB2ZXJzaW9uPSIxLjAiPgo8ZGljdD4KCTxrZXk+QmFj
a2dyb3VuZENvbG9yPC9rZXk+Cgk8ZGF0YT4KCVluQnNhWE4wTUREVUFRSURCQVVHQndwWUpIWmxjbk5w
YjI1WkpHRnlZMmhwZG1WeVZDUjBiM0JZSkc5aWFtVmpkSE1TCglBQUdHb0Y4UUQwNVRTMlY1WldSQmNt
Tm9hWFpsY3RFSUNWUnliMjkwZ0FHakN3d1RWU1J1ZFd4czB3ME9EeEFSRWxkTwoJVTFkb2FYUmxYRTVU
UTI5c2IzSlR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0cmluZz4bWzMy
fjwvc3RyaW5nPgoJCTxrZXk+fkY3MTE8L2tleT4KCQk8c3RyaW5nPhtbMzN+PC9zdHJpbmc+CgkJPGtl
eT5+RjcxMjwva2V5PgoJCTxzdHJpbmc+G1szNH48L3N0cmluZz4KCQk8a2V5Pn5eRjcyODwva2V5PgoJ
CTxzdHJpbmc+GxtbMzs1fjwvc3RyaW5nPgoJPC9kaWN0PgoJPGtleT5uYW1lPC9rZXk+Cgk8c3RyaW5n
Pk1hcmM8L3N0cmluZz4KCTxrZXk+cm93Q291bnQ8L2tleT4KCTxpbnRlZ2VyPjI1PC9pbnRlZ2VyPgoJ
PGtleT50eXBlPC9rZXk+Cgk8c3RyaW5nPldpbmRvdyBTZXR0aW5nczwvc3RyaW5nPgoJPGtleT53YXJu
T25TaGVsbENsb3NlQWN0aW9uPC9rZXk+Cgk8aW50ZWdlcj4wPC9pbnRlZ2VyPgo8L2RpY3Q+CjwvcGxp
c3Q+Cg==

Jup this is indeed by default an issue especially on your almost grey background color.
Because this is quite hard to fix automatically we made a config file we you can change the colors yourself.

  • Go to the status panel and press e
  • For documentation about the config file see /docs/Config.md

The default color theme is hard to read even with the default macOS terminal theme. Please see screenshot below
image

@mjarkk thanks for the advice - worked like a charm.

However I can't figure out how to change the text color. what is the config option for that?

Here is my config:

gui:
  # stuff relating to the UI
  scrollHeight: 2 # how many lines you scroll by
  scrollPastBottom: true # enable scrolling past the bottom
  theme:
    activeBorderColor:
      - magenta
      - bold
    inactiveBorderColor:
      - white
    optionsTextColor:
      - blue
  commitLength:
    show: true
git:
  merging:
    # only applicable to unix users
    manualCommit: false
  skipHookPrefix: WIP
  autoFetch: true
update:
  method: prompt # can be: prompt | background | never
  days: 14 # how often an update is checked for
reporting: 'on' # one of: 'on' | 'off' | 'undetermined'
confirmOnQuit: false
os:
  opencommand: code -r {{filename}}

That's wired i thought we have solved this issue somewhat in: https://github.com/jesseduffield/lazygit/issues/17 but it doesn't look like. Also just tested this myself in the terminal and i have the same result as you in all light themes.

It might be handy if we add a lightMode to the config that sets the right colors for light terminals.
And i think we can read the user terminal background color inside lazygit so we could open a popup and ask the user if they want to use a light theme

This issue is now solved once the next release is out.
In the config file add these config settings and lazygit will work much better on a light theme.

  gui:
    theme:
      lightTheme: true
      activeBorderColor:
        - black
        - bold
      inactiveBorderColor:
        - black

If you used go get to install lazygit you can get the latest changes already using:
go get -u github.com/jesseduffield/lazygit
If you use go 1.13 and up add the @master to the url

Thanks for the fix! Stupid question, but where does the config file go, and what should its filename be? Is that documented somewhere? I checked but couldn't find it. I looked at the source and it seems it would be something like "lazygit.yml", but where?

Never mind, found it by running opensnoop. It seems to be at ~/Library/Application Support/jesseduffield/lazygit/config.yml.

Verified, looks great now, thanks again!

The config file can also be opened by going to the status panel and pressing e to edit the config file.

@mjarkk It'd be great to have this config file somewhere in ~/.config. What do you think about it?
Anyway, thanks a lot for your work.

ya this issue is bought up earlier..
We could do that but currently we are doing it the way it was intended to be used mixed with some inspiration from how the gopath works.
So on mac that is ~/Library/Application Support/jesseduffield/lazygit/config.yml. and on linux ~/.config/jesseduffield/lazygit.

I don't think on mac the ~/Library/Application Support/ will ever be changed but the jesseduffield/ might be removed some day because if you run ls in the os config dir it doesn't show lazygit what makes it harder to find and there are only a small amount of applications that use this kind of path to there config.

Good to know about the "e" key in the status panel. That is not very discoverable. I searched for something like "edit config file" in the menu but couldn't find anything. Now that I know it's "e" I went back to look there again and the label is "edit file". There's no way I would guess that means edit the config file.

Note that the config method is not 100% optimal for systems where dark and light theme gets changed automatically depending on the time of the day (or for users that tend to switch between dark and light theme a lot). Best would be to have this automatic, although I do understand that might be tricky to implement.

Note that the config method is not 100% optimal for systems where dark and light theme gets changed automatically depending on the time of the day (or for users that tend to switch between dark and light theme a lot). Best would be to have this automatic, although I do understand that might be tricky to implement.

This is not that hard, there's a command you can run on OS X and branch whether the system theme is dark or light. I wonder if we could make the config setting dynamic somehow, or able to be set by command line args when running lazygit.

Was this page helpful?
0 / 5 - 0 ratings