4

Often when I open vim some garbage gets printed on the screen of the below sort:

^[[2;2R^[]10;rgb:ffff/ffff/ffff^G^[]11;rgb:0000/0000/0000^G

I'm unable to figure out why. Sometimes, it's on the statusline, sometimes it's above or below it.

Also, many of the times in insert or normal mode the characters don't get refreshed and prints the key that i pressed(e.g. if i press h for left move, h gets printed there) until I change the line. This might be related to the above problem.

redraw seems to wash away these garbage chars but I don't want to do it all the time.

I've also tried set t_RV= as mentioned here to no avail.

The issue might be due to some plugin, au command or maybe a custom statusline that I went for instead of using more popular airline, powerline, etc. I'm not sure.

Here's the link for my .vimrc file.

Below is the output of my $ vim --version:

VIM - Vi IMproved 8.1 (2018 May 17, compiled May 25 2018 00:50:25)
Included patches: 1-22
Compiled by Arch Linux
Huge version with GTK3 GUI.  Features included (+) or not (-):
+acl               +farsi             +mouse_sgr         -tag_any_white
+arabic            +file_in_path      -mouse_sysmouse    +tcl/dyn
+autocmd           +find_in_path      +mouse_urxvt       +termguicolors
-autoservername    +float             +mouse_xterm       +terminal
+balloon_eval      +folding           +multi_byte        +terminfo
+balloon_eval_term -footer            +multi_lang        +termresponse
+browse            +fork()            -mzscheme          +textobjects
++builtin_terms    +gettext           +netbeans_intg     +timers
+byte_offset       -hangul_input      +num64             +title
+channel           +iconv             +packages          +toolbar
+cindent           +insert_expand     +path_extra        +user_commands
+clientserver      +job               +perl/dyn          +vertsplit
+clipboard         +jumplist          +persistent_undo   +virtualedit
+cmdline_compl     +keymap            +postscript        +visual
+cmdline_hist      +lambda            +printer           +visualextra
+cmdline_info      +langmap           +profile           +viminfo
+comments          +libcall           +python/dyn        +vreplace
+conceal           +linebreak         +python3/dyn       +wildignore
+cryptv            +lispindent        +quickfix          +wildmenu
+cscope            +listcmds          +reltime           +windows
+cursorbind        +localmap          +rightleft         +writebackup
+cursorshape       +lua/dyn           +ruby/dyn          +X11
+dialog_con_gui    +menu              +scrollbind        -xfontset
+diff              +mksession         +signs             +xim
+digraphs          +modify_fname      +smartindent       -xpm
+dnd               +mouse             +startuptime       +xsmp_interact
-ebcdic            +mouseshape        +statusline        +xterm_clipboard
+emacs_tags        +mouse_dec         -sun_workshop      -xterm_save
+eval              +mouse_gpm         +syntax            
+ex_extra          -mouse_jsbterm     +tag_binary        
+extra_search      +mouse_netterm     +tag_old_static    
   system vimrc file: "/etc/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "/etc/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.vim/gvimrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
    system menu file: "$VIMRUNTIME/menu.vim"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK  -pthread -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/libdrm -I/usr/include/pango-1.0 -I/usr/include/fribidi -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/harfbuzz -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -D_FORTIFY_SOURCE=2  -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1       
Linking: gcc   -L. -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -fstack-protector -rdynamic -Wl,-export-dynamic -Wl,-E -Wl,-rpath,/usr/lib/perl5/5.26/core_perl/CORE  -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -L/usr/local/lib -Wl,--as-needed -o vim   -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -lfribidi -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lSM -lICE -lXt -lX11 -lXdmcp -lSM -lICE  -lm -ltinfo -lelf -lnsl    -lacl -lattr -lgpm -ldl   -Wl,-E -Wl,-rpath,/usr/lib/perl5/5.26/core_perl/CORE -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -fstack-protector-strong -L/usr/local/lib  -L/usr/lib/perl5/5.26/core_perl/CORE -lperl -lpthread -lnsl -ldl -lm -lcrypt -lutil -lc   -L/usr/lib -ltclstub8.6 -ldl -lz -lpthread -lm

EDIT: I'm using vim from terminal. Below is my output for term variables:

$ echo $TERM
xterm-256color
$ echo $COLORTERM
truecolor
$ echo $SHELL
/bin/bash
helix
  • 1,017
  • 3
  • 12
  • 30
  • GUI or TUI? If TUI, what terminal emulator do you use? *rxvt? – romainl Jul 02 '18 at 06:39
  • @romainl: TUI. updated the question with term variables `COLORTERM`, `TERM` & `SHELL`. – helix Jul 02 '18 at 08:04
  • In this particular case try setting not `set t_RV=` but `set t_u7=` and probably `t_8f` / `t_8b` (also, `:h terminal-output-codes`) – A S Jul 11 '18 at 05:45
  • 1
    Probably relevant: [Garbage is spilled to terminal if statusline contains slow system() call](https://github.com/vim/vim/issues/3197) – Flux Jul 07 '19 at 15:29

1 Answers1

2

I got the same issue with same terminal variables and also with TUI vim, except that the place where it happend was not exactly the same, i.e. not on the status line but in the very begining of my files (it looked however exactly like this or this) and I am using gruvbox color scheme as well (I also have some other vim plugins like syntastic). You can see image before before and after after the fix explained below.

After adding autocmd vimenter * colorscheme gruvbox in my .vimrc before the loading of my plugin manager (pathogen) this went off (I've also removed my previous colorscheme gruvbox command from my .vimrc of course).

I guess as you are also using color schemes (including gruvbox) and if you replace "gruvbox" in the given command for the other color schemes this might work for you as well. Your .vimrc looks pretty complicated though (you are already using autocmd vimenter for other things), thus I am not sure where you should put this in your config file. You could also try to put this after the definition of your status line (that's how it is in my vimrc) but I don't think this would make a difference (see 2nd notes).


Notes

jeremy
  • 228
  • 2
  • 10