vim-syntastic / syntastic

Syntax checking hacks for vim
Do What The F*ck You Want To Public License
11.3k stars 1.14k forks source link

let g:syntastic_check_on_open = 1 causes unexpected behavior in Kitty and iTerm2 terminals #2370

Closed TymekDev closed 3 years ago

TymekDev commented 3 years ago

Hi! I have ran into a problem where my custom highlights are not applied by autocmd ColorScheme. I have pinpointed that this happens when let g:syntastic_check_on_open is set to 1. Additionally, it is present only in Kitty (version 0.21.1) while the default MacOS Terminal works just fine.

With this option enabled, when starting Vim, a black screen with following text appears before the file is loaded:

^[[2;2R^[[3;1R^[[>1;4000;21c^[]10;rgb:f0f0/f0f0/f0f0^[\^[]11;rgb:0808/0808/0808^[\^[P1+r436f=323536^[\^[P1+r6b75=1b4f41^[\^[P1+r6b64=1b4f42^[\^[P1+r6b72=1b4f43^[\^[P1+r6b6c=1b4f44^[\^[P1+r2332=1b5b313b3248^[\^[P1+r2334=1b5b313b3244^[\^[P1+r2569=1b5b313b3243^[\^[P1+r2a37=1b5b313b3246^[\^[P1+r6b31=1b4f50^[\^[P1$r1 q^[\^[[?12;0$y^Z

When let g:syntastic_check_on_open = 1 is left out the above text does not appear and autocmd ColorScheme runs as expected.

.vimrc

set nocompatible
filetype off

set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()

Plugin 'vim-syntastic/syntastic'

call vundle#end()
filetype plugin indent on

augroup ApplyHighlights
  autocmd!
  autocmd ColorScheme * hi Identifier ctermfg=cyan
augroup END

syntax on
colorscheme delek

let g:syntastic_enable_r_lintr_checker = 1
let g:syntastic_r_checkers = ['lintr']

let g:syntastic_check_on_open = 1

vim --version

VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Jun 11 2021 20:05:47)
macOS version - arm64
Included patches: 1-2975
Compiled by Homebrew
Huge version without GUI.  Features included (+) or not (-):
+acl               -farsi             +mouse_sgr         +tag_binary
+arabic            +file_in_path      -mouse_sysmouse    -tag_old_static
+autocmd           +find_in_path      +mouse_urxvt       -tag_any_white
+autochdir         +float             +mouse_xterm       -tcl
-autoservername    +folding           +multi_byte        +termguicolors
-balloon_eval      -footer            +multi_lang        +terminal
+balloon_eval_term +fork()            -mzscheme          +terminfo
-browse            +gettext           +netbeans_intg     +termresponse
++builtin_terms    -hangul_input      +num64             +textobjects
+byte_offset       +iconv             +packages          +textprop
+channel           +insert_expand     +path_extra        +timers
+cindent           +ipv6              +perl              +title
-clientserver      +job               +persistent_undo   -toolbar
+clipboard         +jumplist          +popupwin          +user_commands
+cmdline_compl     +keymap            +postscript        +vartabs
+cmdline_hist      +lambda            +printer           +vertsplit
+cmdline_info      +langmap           +profile           +virtualedit
+comments          +libcall           -python            +visual
+conceal           +linebreak         +python3           +visualextra
+cryptv            +lispindent        +quickfix          +viminfo
+cscope            +listcmds          +reltime           +vreplace
+cursorbind        +localmap          +rightleft         +wildignore
+cursorshape       +lua               +ruby              +wildmenu
+dialog_con        +menu              +scrollbind        +windows
+diff              +mksession         +signs             +writebackup
+digraphs          +modify_fname      +smartindent       -X11
-dnd               +mouse             -sound             -xfontset
-ebcdic            -mouseshape        +spell             -xim
+emacs_tags        +mouse_dec         +startuptime       -xpm
+eval              -mouse_gpm         +statusline        -xsmp
+ex_extra          -mouse_jsbterm     -sun_workshop      -xterm_clipboard
+extra_search      +mouse_netterm     +syntax            -xterm_save
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/opt/homebrew/share/vim"
Compilation: clang -c -I. -Iproto -DHAVE_CONFIG_H -DMACOS_X -DMACOS_X_DARWIN -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 
Linking: clang -L. -fstack-protector-strong -L/opt/homebrew/lib -L/opt/homebrew/opt/libyaml/lib -L/opt/homebrew/opt/openssl@1.1/lib -L/opt/homebrew/opt/readline/lib -o vim -lm -lncurses -liconv -lintl -framework AppKit -L/opt/homebrew/opt/lua/lib -llua5.4 -mmacosx-version-min=11.3 -fstack-protector-strong -L/opt/homebrew/Cellar/perl/5.34.0/lib/perl5/5.34.0/darwin-thread-multi-2level/CORE -lperl -L/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/config-3.9-darwin -lpython3.9 -framework CoreFoundation -lruby.3.0 -L/opt/homebrew/Cellar/ruby/3.0.1/lib

:SyntasticInfo

Syntastic version: 3.10.0-26 (Vim 802, Darwin)
Info for filetype: r
Global mode: active
Filetype r is active
The current file will be checked automatically
Available checker: lintr
Currently enabled checker: lintr
TymekDev commented 3 years ago

Just now I have encountered similar issue in iTerm2 (build 3.4.8). However, the text on the black screen is different. It is either:

^[[?12;4$y

or

^[[2;2R^[[3;1R^[[>0;95;0c^[]10;rgb:c7f1/c7f2/c7f2^G^[]11;rgb:0000/0000/0000^G^[[?12;4$y

Changing every few launches.

lcd047 commented 3 years ago

I sympathize, but this is somebody else's mess. Please see #822.

Also please note that syntastic is essentially dead these days, you might consider switching to something like ALE instead.