1

When I am working in vi there pop up things that look like uninterpreted escape sequences. They come for example when I type i to enter insert mode, or ESC to leave it

Example, triggered by typing i immediately followed by ESC: [>4;m[>4;2m

Version:

vi --version
VIM - Vi IMproved 8.1 (2018 May 18, compiled Apr 15 2020 06:40:31)
Included patches: 1-2269

This has begun a couple of weeks ago, I suspect it comes from patching the Ubuntu operating system. I can clean them with CTRL+L (redraw screen) but they restart popping up as soon as I resume typing.

Guessing that the sequences might try to switch colors, I already applied all the known tricks to disable colors, it makes no difference. The version installed does not even support the syntax on/off (which I find no hardship :) )

Here's my .vimrc:

set nohlsearch
set t_Co=0
highlight LineNr NONE
hi CursorLine NONE
hi Normal cterm=none ctermfg=none ctermbg=none
3
  • Your TERM is most probably wrong. You can try to fix it, or you can try to clear the terminal options t_TE and t_TI. See this answer: vi.stackexchange.com/a/27400/17449
    – user938271
    Mar 6, 2021 at 10:18
  • extended .vimrc and it is ok now. Thanks! I wonder what caused it, though; like as not I'll never know. Mar 6, 2021 at 10:29
  • Welcome to Vi and Vim!
    – D. Ben Knoble
    Mar 6, 2021 at 17:39

2 Answers 2

1

The comment above was indeed the solution. .vimrc now reads as below, probably I can remove some the earlier experiments.

set nohlsearch
set t_Co=0
highlight LineNr NONE
hi CursorLine NONE
hi Normal cterm=none ctermfg=none ctermbg=none
set t_TE=""
set t_TI=""
0

I saw something similar today on Ubuntu 22.04.1 LTS

  • the cause is the vi package installed is vim-tiny, so a minimal version of vim

Installing the more complete version resolved the problem, e.g. doing

$ sudo apt install -y vim

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.