alacritty: Alacritty sometimes fails to invert cursor color (e.g. black cursor in vim with dark colorscheme)
System
OS: Arch Linux Version: alacritty 0.5.0 Sway WM, Wayland. Alacritty Config: https://github.com/alexryndin/dotfiles/blob/7cc014348e758edc56b6e7c4e37213ec89a61171/.config/alacritty/alacritty.yml
Steps to reproduce:
- Launch Alacritty with white background and black cursor config:
$ alacritty --config-file <(echo "colors:
primary:
foreground: '0x000000'
background: '0xeeeeee'
")
- In a new terminal window, launch nvim with no plugins enabled:
nvim -u NONE
- In nvim, set dark colorscheme, elflord for instance:
set termguicolors
colorscheme elflord
Type something and then put cursor on second line: type: itesttest<esc>o
Cursor is on the second line now, but it’s dark and barely visible.
Additional info: I prefer white and black colorscheme in alacritty, but I use dark scheme (gruvbox) in vim. It looks good outside vim: But cursor color fails to match vim’s colorscheme (cursor is on line 2): Compare to gnome-terminal: This is actually very strange behavior, cursor becomes white if it is below non-empty line: But it becomes black if it is above non-empty line:
About this issue
- Original URL
- State: open
- Created 4 years ago
- Reactions: 1
- Comments: 28 (13 by maintainers)
I use onedark theme in neovim encounter this issue, reproduce steps:
alacritty --config-file reproduce.yml
echo -ne '\e[38;2;0;0;0m\e[48;2;229;192;123m\a\e[K'; sleep infinity
echo -ne '\e[38;2;0;0;0m\e[48;2;209;154;102m\a\e[K'; sleep infinity
cat reproduce.yml
https://github.com/alacritty/alacritty/pull/4311 don’t work for my issue.
A minimal repro would provide just the escape sequences necessary to create this problem. @kchibisov was already looking into this using the ref test, so that should hopefully be sufficient.
@chrisduerr it seems like that’s the reproducer. It’s pretty strange, I do remember checking for such things in the past and we were behaving the same with xterm, however maybe not all ‘clearing’ escapes should do that with ‘only bg’ template? Underlines, etc are also not cleared afaics.
I feel like they preserve foreground color? Not sure about flags, they unlikely preserve that, and I do remember testeing for such things i nthe past, however I don’t remember If we actually verified foreground color…
Try
TERM=xterm-256color nvim