
This will return ‘true’ or ‘false’ for dark mode. I tried applescript: osascript -e 'tell application "System Events" to tell appearance preferences to get dark mode' This deterred me and I set out to find more robust way to find the dark mode status.

Now, in catalina if you’re in “Auto” mode and it’s currently light, this command will fail with message: The domain/default pair of (kCFPreferencesAnyApplication, AppleInterfaceStyle) does not exist It seems you used to be able to issue defaults read -g AppleInterfaceStyle and it would report light or dark.

I set out to find a way to determine if the current os configuration is in dark or light mode. Some combination of upgrading my mac os x or switching to fish shell caused my vim to be tricked into thinking the terminal is in dark mode all the time (so the colors were too light on the white background).
