2

I use this version

VIM - Vi IMproved 8.2 (2019 Dec 12 kompiliert am Aug 29 2020 14:11:37)
Inklusive der Patches: 1-1539
Verändert von jonathon.fernyhough@york.ac.uk
Übersetzt von jonathon.fernyhough@york.ac.uk

under Ubuntu 18.04:

Distributor ID: Ubuntu
Description:    Ubuntu 18.04.5 LTS
Release:    18.04
Codename:   bionic

Since a couple of days, my console get's garbled with strange chars like this:

wolfgang@cato:~$ gvim
[>4;m[>4;2mwolfgang@cato:~$

If I use the internal gvim console (:shell) it's pretty useless, since everything I type in is broken with strange char sequences.

I tried to track down the problem. It does not occur with an empty .vimrc. What I found out was that if my .vimrc contains only one single line:

let hostname = substitute(system('hostname'), '\n', '', '')

, this seems to be enough to cause the effect. If I change this to the (useless) line

let hostname = substitute('cato', '\n', '', '')

the effect is gone. So I guess it has something to do with the system() call.

Any idea what could cause this behaviour and how it might get fixed?

slash
  • 73
  • 3
  • 2
    Looks like Vim enables the modifyOtherKeys feature, while your terminal doesn't support it. Your TERM might be misconfigured. Try to add this in your vimrc: let [&t_TI, &t_TE] = ['', '']. Or fix your TERM. – user938271 Sep 05 '20 at 12:39
  • 2
    If I use the internal gvim console (:shell) it's pretty useless, since everything I type in is broken with strange char sequences. Add the ! flag in 'guioptions'; like this set guioptions+=!. – user938271 Sep 05 '20 at 12:43
  • This one is similar: https://vi.stackexchange.com/q/26961/18609 – filbranden Sep 05 '20 at 15:54
  • 1
    Welcome to [vi.se]! – D. Ben Knoble Sep 05 '20 at 15:58
  • @user938271: using let [&t_TI, &t_TE] = ['', ''] reduced the number of printed sequences. My TERM says xterm-256color for a gnome terminal. If I start from a real xterm, everything is fine. Also, export TERM= fixes the problem in a gnome terminal. – slash Sep 05 '20 at 23:41
  • @user938271: set guioptions+=! also fixed the garbled internal console, thank you very much! – slash Sep 05 '20 at 23:44

0 Answers0