Skip to content

Changing colorscheme doesn't change g:terminal_ansi_colors in opened terminal buffer #12344

@craigmac

Description

@craigmac

Sorry for another sort-of-odd one and the mind dump, but try this out:

vim --clean
:set termguicolors
" open some random file, vimrc will do...
:colorscheme blue
:term

Here we are with g:terminal_ansi_colors echo'd and a 256 color test script ran in the terminal buffer:

Screenshot 2023-05-04 at 12 47 24 PM

Now escape to terminal normal mode with <C-\><C-n> and run:

:colorscheme habamax

Screenshot 2023-05-04 at 12 49 21 PM

Echoing g:terminal_ansi_colors we can see that they were set correctly to the new habamax defined colors, but the terminal buffers palette is not actually updated. It stays this way even when I tried re-running the 256 demo script and hiding the terminal buffer and reopening it. I expected switching colorscheme would trigger re-coloring of terminal buffers, but it doesn't seem to work this way, it seems only the terminal buffer background colour is changed. I would think this is better handled in vim/vim, but maybe there's something that could be done on colorscheme side? Just thinking out loud, seems like it could be a can of worms (as usual heh).

This is on latest Alacritty release (no tmux running), macOS, and Vim 9.0.1476 huge without GUI, compiled from source.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions