vim-devicons icon indicating copy to clipboard operation
vim-devicons copied to clipboard

DCS control codes

Open ecx opened this issue 5 years ago • 13 comments

Why after adding vim-devicons to vim with enabled vim-airline, vim start sending DCS control codes(https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Device-Control-functions) to the terminal without it's handling?

Required Info

  • [x] I have searched the issues for my issue and found nothing related and/or helpful
  • [x] I have read or at least glanced at the FAQ
  • [x] I have read or at least glanced at the Wiki
  • [x] VimDevIcons is the last loaded vim plugin? Yes
  • [x] What version of vim are you using? VIM - Vi IMproved 8.1
  • [x] What version of vim-devicons are you using? 0.11.0
  • [x] Are you using vim from the terminal or a GUI vim? terminal, Kitty
  • [x] Are you using Mac, Linux or Windows? Linux

Optional Info

  • [x] Provide screenshots where appropriate

Screenshot from Kitty terminal: Снимок экрана от 2019-04-15 09-02-34 This terminal control codes(DCS) are iniciated and unhandled by vim-devicons. To reproduce a bug launch it like vim test.c, with file who has extension, known to vim-devicons

ecx avatar Apr 15 '19 06:04 ecx

@ecx if you disable vim-devicons does the problem go away or persist?

ryanoasis avatar Jun 28 '19 04:06 ryanoasis

@ryanoasis if i disable vim-devicons problem is goes away

ecx avatar Jun 28 '19 18:06 ecx

@ecx Hi. Would you please tell us the minimal vimrc?

get-me-power avatar Nov 22 '19 22:11 get-me-power

This is the most minimal .vimrc I can get that still reproduces it:

scriptencoding utf-8

if filereadable(expand('$VIMRUNTIME/defaults.vim'))
    unlet! g:skip_defaults_vim
    source $VIMRUNTIME/defaults.vim 
endif
packadd minpac
call minpac#init()

call minpac#add('ryanoasis/vim-devicons')
call minpac#add('vim-airline/vim-airline')

There was a lot of analysis done in the issue I just linked.

I've also noticed that it only happens if both of these are set to 1, as they are by default:

let g:webdevicons_enable_airline_statusline=1
let g:webdevicons_enable_airline_statusline_fileformat_symbols=1

duganchen avatar Mar 15 '20 03:03 duganchen

As mentioned in the linked issue, this is only reproducible in certain terminals, one of which is Kitty.

From trying some of the suggestions listed here:

https://github.com/vim-airline/vim-airline/issues/393

It turns out that either of the following gets rid of the problem:

set t_RV=
set term=builtin_xterm

It's also fairly obvious to me that this is a bug in vim's terminal handling (after all, it's vim that's inserting the escape sequence), and not a bug in devicons, airline or Kitty (which, according to its maintainer, is just less error-tolerant). I have not yet tested to see if it also happens in neovim.

duganchen avatar Mar 15 '20 04:03 duganchen

I am using Tilix terminal, the same problem occurs. image

ImperadorSid avatar Apr 06 '20 19:04 ImperadorSid

Can this issue be reproduced after updating Vim to the latest version?

get-me-power avatar Apr 25 '20 07:04 get-me-power

@kazukazuinaina still reproduceable on VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Apr 14 2020 23:43:46), I'm on ppa:jonathonf/vim it's enough fresh

ecx avatar Apr 25 '20 08:04 ecx

I'd be more interested in whether we can extract that code that triggers this, so that we can produce a .vimrc file that can reproduce it without plugins. That would allow us to enter an issue with vim.

That unfortunately is beyond my skills (I've tried).

duganchen avatar Apr 25 '20 13:04 duganchen

I'm using Fedora 33's vim ('gvim -v') in Fedora 33's Kitty, and I'm not currently seeing this...

duganchen avatar Nov 21 '20 18:11 duganchen

@duganchen Sorry for the late reply. Thanks for your report. Are you saying that this is not a vim-devicons problem? Could we close this problem?

get-me-power avatar Jul 19 '21 17:07 get-me-power

I honestly wouldn't know. I've fully switched from vim to VSCode.

duganchen avatar Jul 23 '21 01:07 duganchen

As @Goku-San mentioned on https://github.com/ryanoasis/vim-devicons/issues/359 adding set t_RV= at the end of .vimrc fixes the issue.

angvp avatar Nov 22 '21 23:11 angvp