Files
neovim/runtime/lua/vim/_core
Justin M. Keyes 436761cba2 fix(tui): late-arriving OSC11 response triggers OptionSet #40270
Problem:
This test is flaky since fff9897ce3 :

    FAILED   ...Xtest_xdg_terminal/test/functional/terminal/tui_spec.lua @ 4359:
    TUI bg color does not trigger OptionSet from automatic background processing
    Expected values to be equal.
    Expected:
    { true, 0 }
    Actual:
    { true, 1 }
    stack traceback:
    ...Xtest_xdg_terminal/test/functional/terminal/tui_spec.lua:4380:
    in function <...Xtest_xdg_terminal/test/functional/terminal/tui_spec.lua:4359>

`apply_optionset_autocmd_now` does not emit `OptionSet` during startup:

    void apply_optionset_autocmd_now(...) {
      // Don't do this while starting up, failure or recursively.
      if (starting || errmsg != NULL || *get_vim_var_str(VV_OPTION_TYPE) != NUL) {
        return;
      }
      ...
    }

but if OSC 11 response arrives AFTER VimEnter, then
`nvim_set_option_value('background',…)` call triggers `OptionSet`.

Solution:
Use `:noautocmd` when setting 'background'.
Per fff9897ce3, OSC11 is not intended to trigger OptionSet.

fix https://github.com/neovim/neovim/issues/40235
2026-06-15 09:12:15 -04:00
..
2026-04-18 15:38:59 -04:00
2026-05-30 12:57:24 +02:00