v:os_appearance doesn't match system

Steps to reproduce

  1. Enable OS dark mode (System Settings > Appearance > Dark)
  2. Verify: defaults read -g AppleInterfaceStyle # => Dark
  3. Check MacVim value mvim --clean +'echo v:os_appearance' # => 0
    Can be replicated by opening the app outside of the terminal and typing :echo v:os_appearance

Expected behaviour

MacVim echoes 1

Version of Vim and architecture

MacVim r179 (Vim 9.1.0), arm64

Environment

  • macOS Sonoma 14.3.1 (23D60) arm64
  • iTerm2 3.5.0beta20
  • zsh 5.9 (x86_64-apple-darwin23.0)

How MacVim was installed

Homebrew

Logs and stack traces

No response

Vim configuration where issue is reproducable

No response

Issue has been tested with given configuration

  • by running MacVim.app from GUI macOS interface
  • by running vim/gvim/etc installed by MacVim
  • by running other versions of vim (e.g. /usr/bin/vim)

Issue has been tested with no configuration

  • by running mvim --clean (or gvim, supplied by MacVim distribution)
  • by running vim --clean (in terminal, supplied by MacVim distribution)
  • by running vim --clean (in terminal, other suppliers, e.g. /usr/bin/vim)

Other conditions

  • The both Homebrew packages "vim" and "macvim" are installed