Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The thing that prevents me from using delta is lack of "system" theme detection. Can't set it up and forget and mismatching theme with shell makes it really difficult to read.


Hi, delta now automatically detects whether the terminal background is light or dark and selects a theme accordingly. (This is due to the nice work of contributor bash: https://github.com/bash/terminal-colorsaurus)


On a not-so-completely unrelated note, if you didn't know on GitHub READMEs you can do things like

  ![img-text](assets//myimg_dark.png#gh-dark-mode-only)
  ![img-text](assets/myimg_light.png#gh-light-mode-only)
To automatically display the light or dark version of images depending on their gh theme (works html style too)

I'm also fond of

  <p align="center">
     ....
  </p>
Which I notice you do :), but did you know you could also do it to tables and center the caption?

  <table align="center">
    <tr>
      <td>
        <img width=800px src="https://user-images.githubusercontent.com/52205/87230973-412eb900-c381-11ea-8aec-cc200290bd1b.png" alt="image" />
        <br>
        <p align="center"><sub>delta with <code>side-by-side</code> and <code>line-numbers</code> activated</sub></p>
      </td>
    </tr>
  </table>
This isn't really a critique or anything, it is that I appreciate that you took the time to make things look pretty and it seems like you'd be interested in this kind of stuff

Also to others, this even works in issues and elsewhere. I find this stuff really helpful when writing issues


Thanks! https://github.com/dandavison/delta/pull/1893

> To automatically display the light or dark version of images depending on their gh theme

Ah, good call. That could be a nice improvement -- creating light and dark versions of the screenshots with switching as you describe.


It’s beautiful, I love it


It will use whatever `bat` theme is set. Bat itself doesn't do system theme detection, but it's easy enough to do in a script - I have one that gets called when my system theme changes where I set themes for various programs. Looks like this for dark mode:

    #!/usr/bin/fish
    gsettings set org.gnome.desktop.interface gtk-theme "Adwaita-dark"
    fish_config theme choose "ayu Mirage"
    yes | fish_config theme save
    echo "--theme=OneHalfDark" > ~/.config/bat/config
    kitten themes --reload-in=all "Ayu Mirage"
The bat config change will make delta respect my "system" theme.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: