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

:terminal + TUI: Redraw bug when resizing #7483

Closed
glacambre opened this issue Nov 4, 2017 · 6 comments
Closed

:terminal + TUI: Redraw bug when resizing #7483

glacambre opened this issue Nov 4, 2017 · 6 comments
Labels
bug issues reporting wrong behavior display redraw, layout, presentation has:repro issue contains minimal reproducing steps has:workaround issue is not fixed but can be circumvented until then terminal built-in :terminal or :shell tui
Milestone

Comments

@glacambre
Copy link
Member

glacambre commented Nov 4, 2017

  • nvim --version: NVIM v0.2.1-1124-g739bc5124
  • Operating system/version: Linux 4.12.12-gentoo
  • Terminal name/version: rxvt-unicode (urxvt) v9.21/XTerm(327)/alacritty 0.1.0
  • $TERM: rxvt-unicode-256color/xterm-256color/xterm-256color

Steps to reproduce using nvim -u NORC

First, start nvim with two horizontal windows, the upper one should be a term and bottom one a regular buffer. Reset syntax highlighting, set cterm=NONE. Append a few characters to the regular buffer. You can do all of that with the following command:

echo -n "aaa" | nvim -u NONE -c "syntax reset | highlight Normal ctermfg=213 ctermbg=213 cterm=NONE | sp term://sh | wincmd j"

Then, "violently" resize your terminal emulator (the one holding the nvim tui): you should see redraw bugs on the upper line.
I can 100% trigger this bug by using i3wm and opening/closing a new window (this divides the nvim window's width by 2 and then resizes it to its previous size).

Actual behaviour

The right half of the first line of the terminal buffer won't be properly redrawn: it will be the default color of the terminal emulator rather than the color set using the highlight Normal command.
Please note that the bug won't be triggered if the cursor is not in the normal buffer or if it is on the first column on the normal buffer.

Expected behaviour

Everything should be the same color.

Edit: Here's a screenshot of what's happening. The upper right corner is black but it should be pink.

@justinmk
Copy link
Member

justinmk commented Nov 4, 2017

Thanks for the clear repro!

With Terminal.app it happens but then fixes itself after ~1s.

Does CTRL-L in normal-mode work around the issue for you?

@justinmk justinmk added terminal built-in :terminal or :shell display redraw, layout, presentation help wanted labels Nov 4, 2017
@justinmk justinmk added this to the unplanned milestone Nov 4, 2017
@justinmk justinmk added the tui label Nov 4, 2017
@justinmk justinmk changed the title Redraw bug when resizing nvim TUI and a terminal buffer is open :terminal + TUI: Redraw bug when resizing Nov 4, 2017
@glacambre
Copy link
Member Author

glacambre commented Nov 4, 2017

Indeed, CTRL-L does fix the display on all three terminal emulators, however waiting for a few seconds doesn't.

@justinmk justinmk added has:repro issue contains minimal reproducing steps has:workaround issue is not fixed but can be circumvented until then labels Nov 4, 2017
@justinmk
Copy link
Member

@glacambre could you try #7624 ? And also try disabling the "bce" capability in your terminfo db.

@glacambre
Copy link
Member Author

Still happens for urxvt (haven't tried other terminal emulators). I may have made a mistake while testing, please let me know if I should do something differently:

$ git rev-parse HEAD
1bd78400f020d20f499d7c6e52f60762e98bff51
$ echo $TERM
rxvt-unicode-256color
$ if tput bce; then; echo enabled; else; echo disabled; fi
disabled
$ echo -n "aaa" | build/bin/nvim -u NONE -c "syntax reset | highlight Normal ctermfg=213 ctermbg=213 cterm=NONE | sp term://sh | wincmd j"

@justinmk
Copy link
Member

@glacambre Thanks. If bce is already disabled then #7624 won't make a difference. Good to rule that out.

@glacambre
Copy link
Member Author

I can still reproduce this on kitty+nvim 3.1 but I can't anymore with kitty+nvim 3.2 so I assume this is fixed, probably by 1adb01c . Thanks @bfredl !

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 has:repro issue contains minimal reproducing steps has:workaround issue is not fixed but can be circumvented until then terminal built-in :terminal or :shell tui
Projects
None yet
Development

No branches or pull requests

2 participants