Navigation Menu

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

tui + termguicolors: Text-glitches since v0.2.1 #7618

Closed
unclechu opened this issue Nov 22, 2017 · 12 comments
Closed

tui + termguicolors: Text-glitches since v0.2.1 #7618

unclechu opened this issue Nov 22, 2017 · 12 comments
Assignees
Labels
bug-regression wrong behavior that was introduced in a previous commit (please bisect) display redraw, layout, presentation tui
Milestone

Comments

@unclechu
Copy link

unclechu commented Nov 22, 2017

Glitches appear on the screen (TUI) when I scroll, switch tab, and do anything that involves rerendering for many symbols of text-matrix. I reproduced it with v0.2.1, v0.2.2 and also latest nightly v0.2.3-dev 9b6bf8f. With v0.2.0 it isn't happening. Every version built from this repo by this commands:

make CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX=/foo/bar/baz"
make install

Termite v12, Neovim v0.2.2:
selection_005
selection_006
selection_007

Konsole v16.12.3, Neovim v0.2.2:
selection_008
selection_009

My config: https://github.com/unclechu/neovimrc/ 89cc8b9

  • nvim --version:
NVIM v0.2.2
Build type: Debug
LuaJIT 2.0.5
Compilation: /usr/bin/cc -Wconversion -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -I/home/unclechu/.compile_n_build/neovim/neovim-v0.2.2-from-git/build/config -I/home/unclechu/.compile_n_build/neovim/neovim-v0.2.2-from-git/src -I/home/unclechu/.compile_n_build/neovim/neovim-v0.2.2-from-git/.deps/usr/include -I/home/unclechu/.compile_n_build/neovim/neovim-v0.2.2-from-git/.deps/usr/include -I/home/unclechu/.compile_n_build/neovim/neovim-v0.2.2-from-git/.deps/usr/include -I/home/unclechu/.compile_n_build/neovim/neovim-v0.2.2-from-git/.deps/usr/include -I/home/unclechu/.compile_n_build/neovim/neovim-v0.2.2-from-git/.deps/usr/include -I/home/unclechu/.compile_n_build/neovim/neovim-v0.2.2-from-git/.deps/usr/include -I/usr/include -I/home/unclechu/.compile_n_build/neovim/neovim-v0.2.2-from-git/build/src/nvim/auto -I/home/unclechu/.compile_n_build/neovim/neovim-v0.2.2-from-git/build/include
Compiled by unclechu@fedorafarm25

Features: +acl +iconv +jemalloc +tui 
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/home/unclechu/neovim-v0.2.2-from-git/share/nvim"

Run :checkhealth for more info
  • Vim (version: v0.2.0) behaves differently?
NVIM v0.2.0
Build type: Debug
Compilation: /usr/bin/cc -Wconversion -DNVIM_MSGPACK_HAS_FLOAT32 -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -I/home/unclechu/.compile_n_build/neovim/neovim-v0.2.0-from-git/build/config -I/home/unclechu/.compile_n_build/neovim/neovim-v0.2.0-from-git/src -I/home/unclechu/.compile_n_build/neovim/neovim-v0.2.0-from-git/.deps/usr/include -I/home/unclechu/.compile_n_build/neovim/neovim-v0.2.0-from-git/.deps/usr/include -I/home/unclechu/.compile_n_build/neovim/neovim-v0.2.0-from-git/.deps/usr/include -I/home/unclechu/.compile_n_build/neovim/neovim-v0.2.0-from-git/.deps/usr/include -I/home/unclechu/.compile_n_build/neovim/neovim-v0.2.0-from-git/.deps/usr/include -I/home/unclechu/.compile_n_build/neovim/neovim-v0.2.0-from-git/.deps/usr/include -I/usr/include -I/home/unclechu/.compile_n_build/neovim/neovim-v0.2.0-from-git/build/src/nvim/auto -I/home/unclechu/.compile_n_build/neovim/neovim-v0.2.0-from-git/build/include
Compiled by unclechu@fedorafarm25

Optional features included (+) or not (-): +acl   +iconv    +jemalloc +tui      
For differences from Vim, see :help vim-differences

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/home/unclechu/neovim-v0.2.0-from-git/share/nvim"
  • Operating system/version: Fedora release 25 (Twenty Five)
  • Terminal name/version:
    • Termite v12
    • Konsole v16.12.3
  • $TERM: xterm-256color
@justinmk
Copy link
Member

What does :checkhealth say in the terminal section? (Env vars)

@unclechu
Copy link
Author

unclechu commented Nov 22, 2017

@justinmk

:CheckHealth for v0.2.0 (everything is okay in this version):

## terminal
  - INFO: key_backspace (kbs) terminfo entry: key_backspace=\177
  - INFO: key_dc (kdch1) terminfo entry: key_dc=\E[3~

:CheckHealth for v0.2.2 (version where glitches appear):

## terminal
  - INFO: key_backspace (kbs) terminfo entry: key_backspace=\177
  - INFO: key_dc (kdch1) terminfo entry: key_dc=\E[3~
  - INFO: $XTERM_VERSION=''
  - INFO: $TERM_PROGRAM=''
  - INFO: $SSH_TTY=''

@duikboot
Copy link

duikboot commented Nov 22, 2017

I do have the same 'problem' for a while also. It occurs most often if I create a vertical split.

I'm on Fedora26, with GNOME Terminal 3.24.2

$ echo $TERM
screen-256color
[ENV]$ vim --version
NVIM v0.2.2-38-gf8d40e7d5
Build type: RelWithDebInfo
LuaJIT 2.0.5
Compilation: /usr/bin/cc -Wconversion -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -O2 -g -DMIN_LOG_LEVEL=3 -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -I/home/arjen/Programms/neovim/build/config -I/home/arjen/Programms/neovim/src -I/home/arjen/Programms/neovim/.deps/usr/include -I/home/arjen/Programms/neovim/.deps/usr/include -I/home/arjen/Programms/neovim/.deps/usr/include -I/home/arjen/Programms/neovim/.deps/usr/include -I/home/arjen/Programms/neovim/.deps/usr/include -I/home/arjen/Programms/neovim/.deps/usr/include -I/usr/include -I/home/arjen/Programms/neovim/build/src/nvim/auto -I/home/arjen/Programms/neovim/build/include
Compiled by arjen@localhost.localdomain

Features: +acl +iconv +jemalloc +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/home/arjen/bin/neovim/share/nvim"
## terminal
  - INFO: key_backspace (kbs) terminfo entry: key_backspace=\177
  - INFO: key_dc (kdch1) terminfo entry: key_dc=\E[3~
  - INFO: $XTERM_VERSION=''
  - INFO: $TERM_PROGRAM=''
  - INFO: $SSH_TTY=''

## tmux
  - OK: escape-time: 0ms
  - INFO: $TERM: screen-256color

@justinmk justinmk added tui bug-regression wrong behavior that was introduced in a previous commit (please bisect) labels Nov 22, 2017
@justinmk justinmk added this to the todo milestone Nov 22, 2017
@justinmk justinmk changed the title Text-glitches since v0.2.1 tui: Text-glitches since v0.2.1 Nov 22, 2017
@justinmk
Copy link
Member

justinmk commented Nov 22, 2017

@unclechu @duikboot do you have set termguicolors ?

@unclechu are you using tmux? If so, TERM=xterm-* is not correct.

Probably #6799 is related, but I thought the issues were worked out by now. Haven't seen any new reports for months.

@justinmk
Copy link
Member

justinmk commented Nov 22, 2017

@unclechu @duikboot can you try this patch? (edit: #7624 )

diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c
index 7ff426239a6e..85bf69e4aec0 100644
--- a/src/nvim/tui/tui.c
+++ b/src/nvim/tui/tui.c
@@ -902,8 +902,7 @@ static void tui_scroll(UI *ui, Integer count)
   if (can_use_scroll(ui)) {
     int saved_row = grid->row;
     int saved_col = grid->col;
-    bool scroll_clears_to_current_colour =
-      unibi_get_bool(data->ut, unibi_back_color_erase);
+    bool scroll_clears_to_current_colour = false;
-
     // Change terminal scroll region and move cursor to the top
     if (!data->scroll_region_is_full_screen) {

justinmk added a commit to justinmk/neovim that referenced this issue Nov 23, 2017
133ae5e implemented BCE (background color erase).  That's fine if
the system terminfo claims to support it; but our built-in fallback
should not assume it.

ref kovidgoyal/kitty#160 (comment)
ref neovim#4210
ref neovim#4421
closes neovim#7618
@justinmk justinmk self-assigned this Nov 23, 2017
justinmk added a commit to justinmk/neovim that referenced this issue Nov 23, 2017
133ae5e implemented BCE (background color erase).  That's fine if
the system terminfo claims to support it; but our built-in fallback
should not assume it.

Per kovidgoyal/kitty#160 (comment)
terminal support for BCE seems to be (1) optional and (2) inconsistent.
So the built-in terminfos should disable it by default.

ref neovim#4210
ref neovim#4421
closes neovim#7618
justinmk added a commit to justinmk/neovim that referenced this issue Nov 23, 2017
133ae5e implemented BCE (background color erase).  That's fine if
the system terminfo claims to support it; but our built-in fallback
should not assume it.

Per kovidgoyal/kitty#160 (comment)
terminal support for BCE seems to be (1) optional and (2) inconsistent.
So the built-in terminfos should disable it by default.

ref neovim#4210
ref neovim#4421
closes neovim#7618
justinmk added a commit to justinmk/neovim that referenced this issue Nov 23, 2017
133ae5e implemented BCE (background color erase).  That's fine if
the system terminfo claims to support it; but our built-in fallback
should not assume it.

Per kovidgoyal/kitty#160 (comment)
terminal support for BCE seems to be (1) optional and (2) inconsistent.
So the built-in terminfos should disable it by default.

ref neovim#4210
ref neovim#4421
ref neovim#7035
ref neovim#7337
ref neovim#7381
ref neovim#7425
closes neovim#7618
@unclechu
Copy link
Author

@justinmk

  1. Yes, I have set termguicolors;
  2. About TERM=xterm-* I set it long time ago in my bash config, I just changed it to screen-256color (still have glitches);
  3. I'll try patch soon and will report about results.

@unclechu
Copy link
Author

@justinmk I just built and tested 1bd7840 (patch #7624) but still have the glitches:
selection_010

@justinmk
Copy link
Member

@unclechu @duikboot Does it happen with nvim -u NORC (or if you disable termguicolors, i.e. don't set it in your config)?

@unclechu
Copy link
Author

@justinmk

  • nvim -u NORC - no glitches
  • disabled termguicolors - no glitches

@justinmk justinmk changed the title tui: Text-glitches since v0.2.1 tui + termguicolors: Text-glitches since v0.2.1 Nov 23, 2017
justinmk added a commit to justinmk/neovim that referenced this issue Nov 23, 2017
133ae5e implemented BCE (background color erase).  That's fine if
the system terminfo claims to support it; but our built-in fallback
should not assume it.

Per kovidgoyal/kitty#160 (comment)
terminal support for BCE seems to be (1) optional and (2) inconsistent.
So the built-in terminfos should disable it by default.

ref neovim#4210 neovim#4421 neovim#7035 neovim#7337 neovim#7381 neovim#7425 neovim#7618
justinmk added a commit to justinmk/neovim that referenced this issue Nov 23, 2017
133ae5e implemented BCE (background color erase).  It has caused
a lot of trouble and gained almost nothing.

Per kovidgoyal/kitty#160 (comment)
terminal support for BCE seems to be (1) optional and (2) inconsistent.

ref neovim#4210 neovim#4421 neovim#7035 neovim#7337 neovim#7381 neovim#7425 neovim#7618
justinmk added a commit to justinmk/neovim that referenced this issue Nov 24, 2017
133ae5e implemented BCE (background color erase). But we can't
trust terminfo, so it is safer disable BCE if we are not certain.

Per kovidgoyal/kitty#160 (comment)
terminal support for BCE seems to be (1) optional and (2) inconsistent.

ref neovim#4210 neovim#4421 neovim#7035 neovim#7337 neovim#7381 neovim#7425 neovim#7618
@justinmk
Copy link
Member

@unclechu @duikboot I think this is the same as #7381 . Please try the minimal steps there and confirm that you can reproduce the issue.

@justinmk justinmk added the display redraw, layout, presentation label Nov 25, 2017
@unclechu
Copy link
Author

@justinmk I haven't time to test it by these steps from another issue, but I just built latest nightly 8813b29 and it looks like this is fixed.

justinmk added a commit to justinmk/neovim that referenced this issue Jan 2, 2019
Remove this vestigial hack from neovim#7624.

Since 5a0d028 we blacklist BCE more surgically. And
patch_terminfo_bugs() is the more appropriate place for that.

ref 5749eca
ref neovim#4210 neovim#4421 neovim#7035 neovim#7337 neovim#7381 neovim#7425 neovim#7618
justinmk added a commit that referenced this issue Jan 2, 2019
Remove this vestigial hack from #7624.

Since 5a0d028 we blacklist BCE more surgically. And
patch_terminfo_bugs() is the more appropriate place for that.

ref 5749eca
ref #4210 #4421 #7035 #7337 #7381 #7425 #7618
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-regression wrong behavior that was introduced in a previous commit (please bisect) display redraw, layout, presentation tui
Projects
None yet
Development

No branches or pull requests

3 participants