1

Sometimes (about once/twice a day), when I open a file in vim, I get a strange line containing meta control characters right at the top of the buffer.

strange line

The line goes away when I refresh the buffer, so it's not really a problem.

I'm just curious to know why it happens. I run vim in a terminal and I'm on ubuntu 18.04.

$> vim --version
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Jun 06 2019 17:31:41)
Included patches: 1-1453

I've used vim on various machines for many years, but my current laptop is the only one where I've seen this happen.

  • 1
    I think it'll be useful if you could include a copy of your ~/.vimrc and perhaps the list of plugins that you use in ~/.vim/ – John Sep 12 at 11:01
  • 1
    Also, which terminal are you using? What is $TERM set to in your shell inside that terminal? – filbranden Sep 12 at 11:40
  • 2
    this is most likely a problem of your terminal configuration. Make sure that $TERM is correct. Also you seem to have termguicolors set. Make sure your terminal actually understands that. – Christian Brabandt Sep 12 at 11:43
  • 1
    I could be wrong but the first CSI sequence (^[[2;2R) looks like the reply to a DSR sequence (Device Status Report). I think it reports the cursor position; here row 2, column 2. The second CSI sequence (^[[>1;5202;0c) looks like the reply to a Send Device Attributes sequence (CSI > Pp ; Pv ; Pc ; c). It's claiming that the terminal type is VT220 (because here Pp is 1), and that its firmware/patch version is 5202 (because here Pv is 5202). – user938271 Sep 12 at 12:12
  • 1
    The purpose of the first OSC sequence (^[]10;rgb:0000/0000/0000^G) is to change the text foreground color, and the last OSC sequence (^[]11;rgb:e0e0/e0e0/e0e0^G) changes the text background color. You can find all of this information on: invisible-island.net/xterm/ctlseqs/ctlseqs.html I guess some program sends those sequences to get some info about the terminal and to change some of its attributes, but the terminal doesn't understand them. As already said, it's often an issue with TERM, or maybe some Vim terminal-related options (:set termcap, :h termcap). – user938271 Sep 12 at 12:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.