You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Wrong background makes equation preview invisible #945
AFAICS recently VSCode stopped writing themes to settings.json and started saving them as part of the workspace state. This seems to confuse the quarto:equation preview panel, which now renders equations white on white when a light theme is active. One workaround is to explicitly set "workbench.colorTheme": "VS Code Light" in settings.json.
PS: while I was testing this I ran into #703 again. Please give it a look, I provided an easy grammar fix.
Steps to reproduce
Create qmd file
Write $x^2$
Position cursor inside the equation
Open the quarto:equation preview
Add "workbench.colorTheme": "VS Code Light" to settings.json
Reload window
Check again
Actual behavior
Renders equations white on white making them invisible.
Expected behavior
Should render equations white on dark or black on light according to the current theme.
Perhaps it's not a recent change in VSCode but that I was using a non default theme until recently.
Anyway the issue is that with "window.autoDetectColorScheme": true VSCode will only set "workbench.preferredLightColorTheme" and "workbench.preferredDarkColorTheme", or even remove them altogether when set to their defaults. Instead "workbench.colorTheme" is always set when "window.autoDetectColorScheme": false and then the equation preview uses the right foreground.
Activity
[-]Wrong background makes equation preview unvisible[/-][+]Wrong background makes equation preview invisible[/+]memeplex commentedon Apr 1, 2026
Perhaps it's not a recent change in VSCode but that I was using a non default theme until recently.
Anyway the issue is that with
"window.autoDetectColorScheme": trueVSCode will only set"workbench.preferredLightColorTheme"and"workbench.preferredDarkColorTheme", or even remove them altogether when set to their defaults. Instead"workbench.colorTheme"is always set when"window.autoDetectColorScheme": falseand then the equation preview uses the right foreground.memeplex commentedon Apr 1, 2026
The issue may be here:
while the right API seems to be
vscode.window.activeColorTheme.kind(api link).kv9898 commentedon Apr 25, 2026
@memeplex my last PR (#864) already suggested using this api:
quarto/apps/vscode/src/lsp/client.ts
Lines 159 to 164 in 5f420f8
it's more likely that the notification was not "caught" by the receiver - I added a time delay in my initial version but it was later removed.