Skip to content

Commit

Permalink
.bashrc: Set $BAT_THEME to get around light/dark-mode stuff
Browse files Browse the repository at this point in the history
The comment summarizes it pretty well, but basically:

- bat (as of 0.22 <sharkdp/bat#2197>) defaults to switching theme based on macOS' light/dark mode
- That isn't the same thing as whether the terminal theme is light or dark
- There are ways to do that, both in Apple's terminal and in iTerm2 (in the 2.5 beta), but until then/if it's not desired, this works
- One day there will [hopefully](sharkdp/bat#1746) be a way to set both light and dark themes for `bat`
- None of this makes much of any difference for `delta`
  • Loading branch information
Amorymeltzer committed Dec 28, 2022
1 parent ef6d68f commit 1cc8211
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,22 @@ else
# makes at least a modicum of effort. Not perfect but at least there's
# *some* delineation
export PERLDOC_PAGER="sh -c 'col -bx | bat -l man -p'"

# Should probably be set in the config file, but this is fine enough. This
# is necessary because bat (intelligently(?)), as of 0.22 (See
# <https://github.com/sharkdp/bat/pull/2197>), adjusts its default behavior
# on macOS to be dependent on light/dark mode. However, it's making the
# assumption that there is a correspondence with light/dark mode in the
# terminal, which doesn't happen automatically. iTerm2's beta of 3.5
# supposedly handles this, and there are some little hacks to do so in
# Apple's terminal, but until I do one of those or decide it's not worth
# it/desirable, setting a specific theme keeps things from adjusting. I
# kind of like how the Coldark themes look, although the defaults (Monokai
# Extended (Light)) are fine. That would of course imply that I'd need to
# specify a method for switching between Coldark-Cold and Coldark-Dark
# depending on the status of light/dark mode (See
# <https://github.com/sharkdp/bat/issues/1746>). Sigh. FIXME TODO
export BAT_THEME='Coldark-Cold'
fi


Expand Down

0 comments on commit 1cc8211

Please sign in to comment.