Skip to content

Broken light/dark theme changing #286176

Open

Description

@RobinKnipe

Type: Bug

The default theming used to change (by following the OS selection), but this recently seems to have broken! Please fix it!!

VS Code version: Code 1.107.1 (994fd12, 2025-12-17T14:15:14.850Z)
OS version: Linux x64 6.14.0-37-generic snap
Modes:

System Info
Item Value
CPUs 12th Gen Intel(R) Core(TM) i9-12900HK (20 x 4300)
GPU Status 2d_canvas: unavailable_software
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: disabled_software
multiple_raster_threads: enabled_on
opengl: disabled_off
rasterization: disabled_software
raw_draw: disabled_off_ok
skia_graphite: disabled_off
trees_in_viz: disabled_off
video_decode: disabled_software
video_encode: disabled_software
vulkan: disabled_off
webgl: unavailable_software
webgl2: unavailable_software
webgpu: disabled_off
webnn: unavailable_software
Load (avg) 11, 17, 17
Memory (System) 31.03GB (13.23GB free)
Process Argv --no-sandbox --force-user-env --ozone-platform=x11 --crash-reporter-id 192967cc-c646-42e9-ac23-0f0101f928d0
Screen Reader no
VM 0%
DESKTOP_SESSION plasma
XDG_CURRENT_DESKTOP KDE
XDG_SESSION_DESKTOP KDE
XDG_SESSION_TYPE x11
Extensions (20)
Extension Author (truncated) Version
swagger-viewer Arj 3.2.0
npm-intellisense chr 1.4.5
vscode-eslint dba 3.0.20
docker doc 0.18.0
gitlens eam 17.8.1
prettier-vscode esb 11.0.2
copilot-chat Git 0.35.2
vscode-github-actions git 0.29.1
vscode-graphql Gra 0.13.2
vscode-graphql-syntax Gra 1.3.8
vscode-containers ms- 2.3.0
vsliveshare ms- 1.0.5959
vscode-jest Ort 6.4.4
postman-for-vscode Pos 1.19.1
vscode-yaml red 1.19.1
sonarlint-vscode Son 4.39.0
code-spell-checker str 4.4.0
code-spell-checker-british-english str 1.4.34
code-spell-checker-cspell-bundled-dictionaries str 2.0.12
explorer vit 1.36.0
A/B Experiments
vsliv368:30146709
binariesv615:30325510
nativeloc1:31344060
dwcopilot:31170013
dwoutputs:31242946
copilot_t_ci:31333650
e5gg6876:31282496
pythonrdcb7:31342333
6518g693:31436602
aj953862:31281341
6abeh943:31336334
envsactivate1:31353494
cloudbuttont:31379625
todos-1:31405332
42190218_ostrepl:31403339
use-responses-api:31390855
ddidtcf:31399634
6j29d282:31407606
3i15c187:31428712
ec5jj548:31422691
terminalsuggestenabled:31431119
cmp-ext-treat:31426748
cp_cls_c_966_ss:31442353
copilot6169-t2000-control:31440805
c0683394:31419495
478ah919:31426797
ge8j1254_inline_auto_hint_haiku:31427726
a5gib710:31434435
38bie571_auto:31426784
request_with_suggest:31435827
rename_enabled:31436409
7a04d226_do_not_restore_last_panel_session:31438103
anthropic_thinking_t:31432745
p_e9cf0154:31434513
406hc587_ask_agent:31428393
cp_cls_c_1081:31433293
copilot-nes-callisto-trt:31434412
nowdiget:31442216
nes-slash-models-on:31441832
nes-set-to-on:31441941

Activity

  1. aeschli commented on Jan 7, 2026

    @aeschli
    Contributor

    What OS do you have?
    Do you have "window.autoDetectColorScheme": true ? What are the values of workbench.preferredDarkColorTheme and workbench.preferredLightColorTheme?

  2. added
    editor-theming
    info-needed
    on Jan 7, 2026
  3. RobinKnipe commented on Jan 8, 2026

    @RobinKnipe
    Author

    Hi Martin Aeschlimann (@aeschli) - I'm a Linux user (Kubuntu v24.04, KDE Plasma Version 5.27.12, kernel 6.14.0-37-generic).
    Please see relevant settings values (just defaults plus auto detect), in a short screencast of a transition to/from night mode (note the browser [right] and folder [bottom-left] windows change in line with the mode selection as it pops up [bottom-right]), I hope that helps!

    code-theme.webm
  4. f2w00 commented on Jan 12, 2026

    @f2w00

    OS: Manjaro Linux x86_64
    Host: Code01 Ver2.0 (1)
    Kernel: Linux 6.17.13-1-MANJARO
    Uptime: 7 days, 14 hours, 33 mins
    Packages: 1533 (pacman)[stable]
    Shell: zsh 5.9
    Display (PDA 24"): 1920x1080 in 24", 75 Hz [External]
    DE: GNOME 49.2
    WM: Mutter (Wayland)
    WM Theme: Breeze
    Theme: Breeze [GTK2/3/4]
    Icons: Tela-dark [GTK2/3/4]
    Font: JetBrainsMono Nerd Font Mono Medium (10pt) [GTK2/3/4]
    Cursor: Bibata-Modern-Ice (24px)
    Terminal: GNOME Console 49.2
    Terminal Font: JetBrains Mono Medium (10pt)
    CPU: AMD Ryzen 7 6800H (16) @ 4.79 GHz
    GPU: AMD Radeon 680M [Integrated]
    Memory: 8.41 GiB / 22.20 GiB (38%)
    Swap: Disabled
    Disk (/): 57.56 GiB / 92.95 GiB (62%) - ext4
    Battery (SSBS81): 101% [AC Connected]
    Locale: en_US.UTF-8
    vscode 1.108.0

    same on gnome,

    and "window.autoDetectColorScheme": true ,workbench.preferredDarkColorTheme : "Theme" and workbench.preferredLightColorTheme : "Better Solarized Light".

    i'm not pretty sure about which version makes this change, it works before.

    edit: i don't know why, but i changed my gnome theme and then change it back, the "autoDetectColorScheme" works again

  5. RobinKnipe commented on Jan 12, 2026

    @RobinKnipe
    Author

    In case it helps: my OS themes alternate between:

    • Breeze
    • BreezeDark

    It seems Code is incorrectly interpreting the current theme as always being Light (even though neither theme actually declares this preference), see this screencast showing what happens when the autoDetectColorScheme setting is toggled with all theme settings at their defaults:

    code-theme-forever-day.webm

    The 2 themes declare the following preferences:

    • for the BreezeDark theme, the Dark preference (denoted by unit32 1)
      gdbus call \
        --session \
        --dest org.freedesktop.portal.Desktop \
        --object-path /org/freedesktop/portal/desktop \
        --method org.freedesktop.portal.Settings.Read \
        org.freedesktop.appearance color-scheme
      (<<uint32 1>>,)
    • for the Breeze theme, no preference (denoted by unit32 2)
      gdbus call \
        --session \
        --dest org.freedesktop.portal.Desktop \
        --object-path /org/freedesktop/portal/desktop \
        --method org.freedesktop.portal.Settings.Read \
        org.freedesktop.appearance color-scheme
      (<<uint32 2>>,)
  6. flying-sheep commented on Jan 19, 2026

    @flying-sheep
    Contributor

    I use the same themes, and for me VS Code sets the correct scheme when started, but changing the system theme (or toggling autoDetectColorScheme off and on again) while it’s running does nothing.

  7. aeschli commented on Jan 19, 2026

    @aeschli
    Contributor

    Likely this is a change/bug in Electron which we use to detect the OS theme changes.
    Can you:

    • install the latest Insider build 1.109
    • F1 and run the Developer > Show Log... command, pick Main
    • in the Output view that shows click on the gear icon and select Debug
    • Now switch the OS theme
    • The Output view will log the events that we get from Electron
      e.g.
    2026-01-19 18:57:29.854 [debug] [theme main service] window.autoDetectColorScheme=true, window.autoDetectHighContrast=true, window.systemColorTheme=default
    2026-01-19 18:57:29.855 [debug] [theme main service] electron.nativeTheme: themeSource=system, shouldUseDarkColors=true, shouldUseHighContrastColors=false, shouldUseInvertedColorScheme=false, shouldUseDarkColorsForSystemIntegratedUI=false	
    2026-01-19 18:57:29.855 [debug] [theme main service] New color scheme: {"dark":true,"highContrast":false}
    

    Please tell me what your interactions were (e.g. light -> dark) and what was logged.

  8. flying-sheep commented on Jan 19, 2026

    @flying-sheep
    Contributor

    Absolutely nothing. I switched in both directions, no logs.

    Version: 1.109.0-insider
    Commit: f8f8ba0
    Date: 2026-01-19T17:02:35.802Z
    Electron: 39.2.7
    ElectronBuildId: 13098910
    Chromium: 142.0.7444.235
    Node.js: 22.21.1
    V8: 14.2.231.21-electron.0
    OS: Linux x64 6.18.5-arch1-1

    Image
  9. aeschli commented on Jan 19, 2026

    @aeschli
    Contributor

    Oh, please use Debug
    Close all VS Code windows and start VS Code with code-insiders --log=debug.
    The main Output view should show the initial Electron settings

  10. flying-sheep commented on Jan 19, 2026

    @flying-sheep
    Contributor

    OK, this is me starting it up with a light theme …

    2026-01-19 21:21:57.860 [debug] [theme main service] window.autoDetectColorScheme=true, window.autoDetectHighContrast=true, window.systemColorTheme=default
    2026-01-19 21:21:57.860 [debug] [theme main service] electron.nativeTheme: themeSource=system, shouldUseDarkColors=false, shouldUseHighContrastColors=false, shouldUseInvertedColorScheme=false, shouldUseDarkColorsForSystemIntegratedUI=false	
    2026-01-19 21:21:57.860 [debug] [theme main service] New color scheme: {"dark":false,"highContrast":false}
    2026-01-19 21:21:57.860 [info] update#setState idle
    2026-01-19 21:21:59.095 [debug] Terminal profile not validated pwsh ["pwsh"]
    

    … and then switching to dark:

    2026-01-19 21:22:13.333 [debug] [theme main service] window.autoDetectColorScheme=true, window.autoDetectHighContrast=true, window.systemColorTheme=default
    2026-01-19 21:22:13.333 [debug] [theme main service] electron.nativeTheme: themeSource=system, shouldUseDarkColors=false, shouldUseHighContrastColors=false, shouldUseInvertedColorScheme=false, shouldUseDarkColorsForSystemIntegratedUI=false	
    2026-01-19 21:22:13.333 [debug] [theme main service] New color scheme: {"dark":false,"highContrast":false}
    2026-01-19 21:22:13.334 [debug] [theme main service] window.autoDetectColorScheme=true, window.autoDetectHighContrast=true, window.systemColorTheme=default
    2026-01-19 21:22:13.334 [debug] [theme main service] electron.nativeTheme: themeSource=system, shouldUseDarkColors=false, shouldUseHighContrastColors=false, shouldUseInvertedColorScheme=false, shouldUseDarkColorsForSystemIntegratedUI=false	
    2026-01-19 21:22:13.334 [debug] [theme main service] New color scheme: {"dark":false,"highContrast":false}
    2026-01-19 21:22:13.334 [debug] [theme main service] window.autoDetectColorScheme=true, window.autoDetectHighContrast=true, window.systemColorTheme=default
    2026-01-19 21:22:13.334 [debug] [theme main service] electron.nativeTheme: themeSource=system, shouldUseDarkColors=false, shouldUseHighContrastColors=false, shouldUseInvertedColorScheme=false, shouldUseDarkColorsForSystemIntegratedUI=false	
    2026-01-19 21:22:13.334 [debug] [theme main service] New color scheme: {"dark":false,"highContrast":false}
    2026-01-19 21:22:13.334 [debug] [theme main service] window.autoDetectColorScheme=true, window.autoDetectHighContrast=true, window.systemColorTheme=default
    2026-01-19 21:22:13.334 [debug] [theme main service] electron.nativeTheme: themeSource=system, shouldUseDarkColors=false, shouldUseHighContrastColors=false, shouldUseInvertedColorScheme=false, shouldUseDarkColorsForSystemIntegratedUI=false	
    2026-01-19 21:22:13.334 [debug] [theme main service] New color scheme: {"dark":false,"highContrast":false}
    2026-01-19 21:22:13.335 [debug] [theme main service] window.autoDetectColorScheme=true, window.autoDetectHighContrast=true, window.systemColorTheme=default
    2026-01-19 21:22:13.335 [debug] [theme main service] electron.nativeTheme: themeSource=system, shouldUseDarkColors=false, shouldUseHighContrastColors=false, shouldUseInvertedColorScheme=false, shouldUseDarkColorsForSystemIntegratedUI=false	
    2026-01-19 21:22:13.335 [debug] [theme main service] New color scheme: {"dark":false,"highContrast":false}
    2026-01-19 21:22:13.399 [debug] [theme main service] window.autoDetectColorScheme=true, window.autoDetectHighContrast=true, window.systemColorTheme=default
    2026-01-19 21:22:13.399 [debug] [theme main service] electron.nativeTheme: themeSource=system, shouldUseDarkColors=false, shouldUseHighContrastColors=false, shouldUseInvertedColorScheme=false, shouldUseDarkColorsForSystemIntegratedUI=false	
    2026-01-19 21:22:13.399 [debug] [theme main service] New color scheme: {"dark":false,"highContrast":false}
    
    

    … and then swicthing back to light:

    2026-01-19 21:23:48.312 [debug] [theme main service] window.autoDetectColorScheme=true, window.autoDetectHighContrast=true, window.systemColorTheme=default
    2026-01-19 21:23:48.312 [debug] [theme main service] electron.nativeTheme: themeSource=system, shouldUseDarkColors=false, shouldUseHighContrastColors=false, shouldUseInvertedColorScheme=false, shouldUseDarkColorsForSystemIntegratedUI=false	
    2026-01-19 21:23:48.312 [debug] [theme main service] New color scheme: {"dark":false,"highContrast":false}
    2026-01-19 21:23:48.312 [debug] [theme main service] window.autoDetectColorScheme=true, window.autoDetectHighContrast=true, window.systemColorTheme=default
    2026-01-19 21:23:48.312 [debug] [theme main service] electron.nativeTheme: themeSource=system, shouldUseDarkColors=false, shouldUseHighContrastColors=false, shouldUseInvertedColorScheme=false, shouldUseDarkColorsForSystemIntegratedUI=false	
    2026-01-19 21:23:48.312 [debug] [theme main service] New color scheme: {"dark":false,"highContrast":false}
    2026-01-19 21:23:48.313 [debug] [theme main service] window.autoDetectColorScheme=true, window.autoDetectHighContrast=true, window.systemColorTheme=default
    2026-01-19 21:23:48.313 [debug] [theme main service] electron.nativeTheme: themeSource=system, shouldUseDarkColors=false, shouldUseHighContrastColors=false, shouldUseInvertedColorScheme=false, shouldUseDarkColorsForSystemIntegratedUI=false	
    2026-01-19 21:23:48.313 [debug] [theme main service] New color scheme: {"dark":false,"highContrast":false}
    2026-01-19 21:23:48.313 [debug] [theme main service] window.autoDetectColorScheme=true, window.autoDetectHighContrast=true, window.systemColorTheme=default
    2026-01-19 21:23:48.313 [debug] [theme main service] electron.nativeTheme: themeSource=system, shouldUseDarkColors=false, shouldUseHighContrastColors=false, shouldUseInvertedColorScheme=false, shouldUseDarkColorsForSystemIntegratedUI=false	
    2026-01-19 21:23:48.313 [debug] [theme main service] New color scheme: {"dark":false,"highContrast":false}
    2026-01-19 21:23:48.313 [debug] [theme main service] window.autoDetectColorScheme=true, window.autoDetectHighContrast=true, window.systemColorTheme=default
    2026-01-19 21:23:48.313 [debug] [theme main service] electron.nativeTheme: themeSource=system, shouldUseDarkColors=false, shouldUseHighContrastColors=false, shouldUseInvertedColorScheme=false, shouldUseDarkColorsForSystemIntegratedUI=false	
    2026-01-19 21:23:48.313 [debug] [theme main service] New color scheme: {"dark":false,"highContrast":false}
    
  11. flying-sheep commented on Jan 19, 2026

    @flying-sheep
    Contributor

    starting with a dark theme:

    2026-01-19 21:25:06.805 [debug] [theme main service] window.autoDetectColorScheme=true, window.autoDetectHighContrast=true, window.systemColorTheme=default
    2026-01-19 21:25:06.805 [debug] [theme main service] electron.nativeTheme: themeSource=system, shouldUseDarkColors=true, shouldUseHighContrastColors=false, shouldUseInvertedColorScheme=false, shouldUseDarkColorsForSystemIntegratedUI=true	
    2026-01-19 21:25:06.805 [debug] [theme main service] New color scheme: {"dark":true,"highContrast":false}
    

    then switching to light:

    2026-01-19 21:25:48.571 [debug] [theme main service] window.autoDetectColorScheme=true, window.autoDetectHighContrast=true, window.systemColorTheme=default
    2026-01-19 21:25:48.571 [debug] [theme main service] electron.nativeTheme: themeSource=system, shouldUseDarkColors=true, shouldUseHighContrastColors=false, shouldUseInvertedColorScheme=false, shouldUseDarkColorsForSystemIntegratedUI=true	
    2026-01-19 21:25:48.571 [debug] [theme main service] New color scheme: {"dark":true,"highContrast":false}
    2026-01-19 21:25:48.572 [debug] [theme main service] window.autoDetectColorScheme=true, window.autoDetectHighContrast=true, window.systemColorTheme=default
    2026-01-19 21:25:48.572 [debug] [theme main service] electron.nativeTheme: themeSource=system, shouldUseDarkColors=true, shouldUseHighContrastColors=false, shouldUseInvertedColorScheme=false, shouldUseDarkColorsForSystemIntegratedUI=true	
    2026-01-19 21:25:48.572 [debug] [theme main service] New color scheme: {"dark":true,"highContrast":false}
    2026-01-19 21:25:48.572 [debug] [theme main service] window.autoDetectColorScheme=true, window.autoDetectHighContrast=true, window.systemColorTheme=default
    2026-01-19 21:25:48.572 [debug] [theme main service] electron.nativeTheme: themeSource=system, shouldUseDarkColors=true, shouldUseHighContrastColors=false, shouldUseInvertedColorScheme=false, shouldUseDarkColorsForSystemIntegratedUI=true	
    2026-01-19 21:25:48.572 [debug] [theme main service] New color scheme: {"dark":true,"highContrast":false}
    2026-01-19 21:25:48.572 [debug] [theme main service] window.autoDetectColorScheme=true, window.autoDetectHighContrast=true, window.systemColorTheme=default
    2026-01-19 21:25:48.572 [debug] [theme main service] electron.nativeTheme: themeSource=system, shouldUseDarkColors=true, shouldUseHighContrastColors=false, shouldUseInvertedColorScheme=false, shouldUseDarkColorsForSystemIntegratedUI=true	
    2026-01-19 21:25:48.572 [debug] [theme main service] New color scheme: {"dark":true,"highContrast":false}
    2026-01-19 21:25:48.573 [debug] [theme main service] window.autoDetectColorScheme=true, window.autoDetectHighContrast=true, window.systemColorTheme=default
    2026-01-19 21:25:48.573 [debug] [theme main service] electron.nativeTheme: themeSource=system, shouldUseDarkColors=true, shouldUseHighContrastColors=false, shouldUseInvertedColorScheme=false, shouldUseDarkColorsForSystemIntegratedUI=true	
    2026-01-19 21:25:48.573 [debug] [theme main service] New color scheme: {"dark":true,"highContrast":false}
    2026-01-19 21:25:48.573 [debug] [theme main service] window.autoDetectColorScheme=true, window.autoDetectHighContrast=true, window.systemColorTheme=default
    2026-01-19 21:25:48.573 [debug] [theme main service] electron.nativeTheme: themeSource=system, shouldUseDarkColors=true, shouldUseHighContrastColors=false, shouldUseInvertedColorScheme=false, shouldUseDarkColorsForSystemIntegratedUI=true	
    2026-01-19 21:25:48.573 [debug] [theme main service] New color scheme: {"dark":true,"highContrast":false}
    

    and I think we can both guess what happens if I switch back to dark.

  12. flying-sheep commented on Jan 20, 2026

    @flying-sheep
    Contributor

    I think I found the upstream bug: electron/electron#48736

  13. aeschli commented on Jan 20, 2026

    @aeschli
    Contributor

    Philipp A. (@flying-sheep) Thanks for finding the upstream issue!

  14. added
    bug
    upstream
    electron
    regression
    upstream-issue-linked
    and removed
    info-needed
    on Jan 20, 2026
  15. flying-sheep commented on Jan 20, 2026

    @flying-sheep
    Contributor

    No problem! Seems to go up all the way to Chromium, see the issue linked in electron/electron#48736 (comment)

  16. KayJay7 commented on Oct 30, 2026

    @KayJay7

    14. Philipp A. (@flying-sheep) Thanks for finding the upstream issue!

    That upstream bug has recently been solved: electron/electron#48736. It's fixed in electron 45 which updated the chromium dependency.

    So this issue can be picked up again. It should just be a matter of updating electron.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugeditor-themingelectronelectron-39-updateregressionupstreamupstream-issue-linked

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions