Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When enabling cursorline, it only underlines text rather than the whole line on screen #25609

Open
rex-ludorum opened this issue Oct 12, 2023 · 10 comments
Labels
bug issues reporting wrong behavior display redraw, layout, presentation environment user system environment (terminal, shell, tmux) platform:windows tui

Comments

@rex-ludorum
Copy link

rex-ludorum commented Oct 12, 2023

Problem

In my .vimrc, I have

set cursorline
hi clear CursorLine
hi CursorLine gui=underline cterm=underline

to enable underlining. In Vim, this underlines the whole line in the screen as expected, even without whitespace trailing the text:
msys_vim

However, in Neovim (my nvim setup sources my .vimrc), this only underlines the portion of the line with text along with leading whitespace:
msys_neovim1

Rarely, it doesn't underline leading indentations or manages to underline the rest of the line. I have no clue what the criteria for these cases are:
msys_neovim3
msys_neovim2

Moreover, this is only a problem on Windows, where I have nvim installed on msys through pacman. On Ubuntu with the same config, the whole line is always underlined:
ubuntu-neovim

I'd like to have neovim on Windows behave consistently with Ubuntu and underline the whole line.

Steps to reproduce

See above

Expected behavior

The whole line should be underlined, not only the portion with text.

Neovim version (nvim -v)

0.9.2

Vim (not Nvim) behaves the same?

no, 9.0.1976

Operating system/version

Windows 10

Terminal name/version

mintty 3.6.5

$TERM environment variable

xterm-256color

Installation

pacman on msys2
pacman -S mingw-w64-ucrt-x86_64-neovim

@rex-ludorum rex-ludorum added the bug issues reporting wrong behavior label Oct 12, 2023
@zeertzjq zeertzjq added platform:windows display redraw, layout, presentation labels Oct 12, 2023
@justinmk justinmk added the tui label Oct 12, 2023
@justinmk
Copy link
Member

Latest stable release is 0.9.4, not 0.9.2. Also try the prerelease https://github.com/neovim/neovim/releases/tag/nightly .

Terminal name/version : mintty 3.6.5

Does it happen if with cmd.exe or Windows terminal ?

@rex-ludorum
Copy link
Author

rex-ludorum commented Oct 12, 2023

I updated to 0.9.4 and tried the prerelease and the problem persists. Running nvim in cmd or Windows Terminal fixes it though.

@zeertzjq zeertzjq added the environment user system environment (terminal, shell, tmux) label Oct 12, 2023
@rex-ludorum
Copy link
Author

I tried installing my setup on a different Windows 11 computer and the problem is fixed on there. The problem only happens on my Windows 10 computer.

@justinmk
Copy link
Member

Then this is likely a terminal issue and not going to to spend time adding a workaround.

@justinmk justinmk closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2023
@mintty
Copy link

mintty commented Oct 22, 2023

nvim was logged to send wrong escape sequences in the documented scenario:
mintty/mintty#1239 (comment)

@zeertzjq zeertzjq reopened this Oct 23, 2023
@zeertzjq
Copy link
Member

zeertzjq commented Oct 23, 2023

@rex-ludorum Do you have infocmp command available in MSYS2? Try searching and installing some packages containing ncurses in their names if infocmp is not present. If infocmp is available, what does infocmp -Lx print in mintty?

@mintty
Copy link

mintty commented Oct 23, 2023

infocmp does not depend on the terminal, it only considers $TERM
I've tried to vary on xterm-256color etc already.

@zeertzjq
Copy link
Member

zeertzjq commented Oct 23, 2023

Yes, but I don't get \x1b[16X or \x1b[m in XTerm. What I get is 16 spaces and \x1b[0;4m.

With syntax:

\x1b(B\x1b[0;4m                \x1b(B\x1b[0;4m\x1b[93mwhile\x1b(B\x1b[0;4m ((bytes_read = read(\x1b(B\x1b[0;4m\x1b[95mSTDIN_FILENO\x1b(B\x1b[0;4m, buf, SEND_BUFFER_SIZE)) > \x1b(B\x1b[0;4m\x1b[95m0\x1b(B\x1b[0;4m) {                                                                                                         

Without syntax:

\x1b(B\x1b[0;4m                while ((bytes_read = read(STDIN_FILENO, buf, SEND_BUFFER_SIZE)) > 0) {                                                                                                         

@rex-ludorum
Copy link
Author

rex-ludorum commented Oct 23, 2023

I do have it installed. infocmp -V gives ncurses 6.4.20221231.

infocmp -Lx gives infocmp-out.txt

@zeertzjq
Copy link
Member

zeertzjq commented Oct 24, 2023

Hmm, that's also the same as the terminfo of XTerm on Linux, so it's really strange that these sequences are quite different from what I get in XTerm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug issues reporting wrong behavior display redraw, layout, presentation environment user system environment (terminal, shell, tmux) platform:windows tui
Projects
None yet
Development

No branches or pull requests

4 participants