#42161·neovim

Visual selection cursor cell becomes unreadable in the terminal

Author: shuansCreated Sep 30, 2026Updated Sep 30, 2026
Labelsneeds:reprobug-regressionhighlightvisual-mode

Visual selection cursor cell becomes unreadable in the terminal

Problem

After upgrading from Neovim 0.12.5 to Neovim 0.13, the character under the cursor in a Visual selection is rendered differently from the rest of the selection.

This is especially noticeable when the Visual highlight uses reverse = true. The selected characters are readable, but the character at the cursor position becomes hard to read or appears to have a different color.

This seems related to:

  • vim-patch:9.2.1114
  • #42105
  • the removal of the noinvcur handling

Steps to reproduce

  1. Start Neovim in a terminal.
  2. Configure Visual mode with reverse video:
lua
vim.opt.termguicolors = true

vim.api.nvim_set_hl(0, "Visual", {
  reverse = true,
  bg = "#665c54",
})
  1. Enter the following text:
abcd
  1. Enter Visual mode and select the text with vll

Expected behavior

All selected characters, including the character under the cursor, should remain readable and have the same Visual selection appearance.

Actual behavior

The character under the cursor is rendered differently from the rest of the Visual selection and may become difficult to read.

This did not happen with the same configuration in Neovim 0.12.5.

Workaround

Changing the cursor shape in Visual mode avoids the problem:

vim
:set guicursor=v:hor10-Visual

or in Lua:

lua
vim.opt.guicursor = {
  "n-c-sm:block-Cursor",
  "v:hor10-Visual",
  "i-ci-ve:ver25-Cursor",
  "r-cr-o:hor20-Cursor",
}

Environment

  • Neovim version: 0.13.0-dev (previously 0.12.5)
  • OS: Ubuntu 20.04
  • Terminal emulator: the default GNOME Terminal shipped with Ubuntu 20.04 (running on Wayland/X11 session, not in tmux)
  • $TERM: xterm-256color
  • $COLORTERM: truecolor
  • tmux: no
  • termguicolors: on
  • guicursor: default (not set)

Additional information

The behavior appears to be related to the interaction between:

  1. Visual selection using reverse video;
  2. the terminal drawing the cursor by inverting the cursor cell;
  3. the new behavior that includes the cursor position in the Visual selection highlighting.

The workaround works by using a horizontal cursor in Visual mode, but it would be preferable if the default terminal rendering did not make the character under the cursor unreadable.