Record verified light-mode results for the theme hooks
Tested with the system actually in light mode rather than inferred from dark: - the status bar switches in the same second client-light-theme fires - a fresh nvim reports background=light, so the OSC 11 round trip through tmux to ghostty works and restarting nvim is genuinely sufficient - delta resolves syntax-theme = GitHub, its light default, against Monokai Extended on dark, so it does detect the terminal background Both the nvim and delta checks needed a real tty to be meaningful. Run with stdout on a pipe they each fall back to their dark default, which looks like a correct answer while proving nothing. Also documents why the first Light switch did not move the status bar: tmux enables the terminal's theme-reporting mode when a client attaches, so the client that predated these hooks was never asked to report changes. A detach and reattach fixes it, and a fresh server never sees it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
6b3ab420ad
commit
39d52fbbcf
1 changed files with 13 additions and 2 deletions
15
README.md
15
README.md
|
|
@ -84,8 +84,19 @@ toggling Light/Dark by hand — nothing in the chain knows why it changed.
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
> A running nvim will not follow a live change: the docs are explicit that the
|
> A running nvim will not follow a live change: the docs are explicit that the
|
||||||
> TUI sets `background` *on startup* if it can detect it. New instances are
|
> TUI sets `background` *on startup* if it can detect it. New instances are
|
||||||
> fine; existing ones need `:set background=light` or a restart. delta is
|
> fine — verified, a fresh nvim in light mode reports `background=light` — but
|
||||||
> per-invocation so should be fine, but that is untested here.
|
> existing ones need `:set background=light` or a restart.
|
||||||
|
|
||||||
|
Verified in light mode: the status bar switches in the same second the hook
|
||||||
|
fires, a fresh nvim detects `light`, and delta resolves its light default
|
||||||
|
(`syntax-theme = GitHub`, against `Monokai Extended` on dark).
|
||||||
|
|
||||||
|
> [!TIP]
|
||||||
|
> When adding these hooks to an *already running* tmux server, detach and
|
||||||
|
> reattach. tmux enables the terminal’s theme-reporting mode when a client
|
||||||
|
> attaches, so a client that predates the hooks never gets asked to report
|
||||||
|
> changes — `#{client_theme}` still reads correctly, because that is answered by
|
||||||
|
> a direct query, but no hook fires until the client reattaches.
|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
> This previously used [`dark-mode-notify`](https://github.com/bouk/dark-mode-notify)
|
> This previously used [`dark-mode-notify`](https://github.com/bouk/dark-mode-notify)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue