1

I just updated to the latest vim (git fetch && git merge origin/master followed by building and installing to /usr/local/...). Everything is great except with a little extra stuff I added to my .vimrc file to add the location of C++ compiler and add it to path so that opening system include files work. This is the couple of lines that makes this happen:

let gppver=system('g++ --version | perl -ne ''/(\d+\.\d+\.\d+)/ && print $1''')
execute 'set path+=/usr/include/c++/' . g:gppver

After some trial and error, I've finally discovered that it's the use of system(). I don't understand why. When that line executes, actually, at the moment that line is commented and I have this because I thought it was my command, let gppver = system('ls'). Even that simple line results in this being echoed to the stdout during startup:

[>4;m[>4;2m

It doesn't show well in the post, but it's ^[>4;m^[>4;m or ESC+[ .... Where is this coming from? Prior to doing the git fetch and merge, I was running 8.2. I forget which. However, I hadn't updated at work since March (or earlier). Looking at the git log, the latest node on master is the tag 8.2.1959. Some pointers on why these extra characters are showing would be greatly appreciated. Just verified to ensure it really is that function, with every other line commented in my .vimrc file but let gppver = system('ls'), the extra characters are printed.

5
  • 1
    Perhaps not a direct answer... but see this answer for more details on the ^[[>4;2m sequence, it's related to the modifyOtherKeys feature of xterm. This feature was introduced in Vim 8.1.2134 and enabled by default in Vim 8.1.2194. See the full answer for more details and possible workarounds.
    – filbranden
    Nov 5, 2020 at 21:24
  • 1
    @filbranden thank you. That was indeed the issue. I may have read for weeks before stumbling on that one. Nov 5, 2020 at 21:38
  • Please write a self-answer to indicate which solution worked for you. (Or let us know if you think it would be OK to mark this question as a duplicate of that one.)
    – filbranden
    Nov 5, 2020 at 21:40
  • 1
    There may be a way to delay this so it doesnt happen at startup, or otherwise run the command in a way that won’t interfere with stdout
    – D. Ben Knoble
    Nov 6, 2020 at 0:41
  • 1
    @filbranden although the symptoms were different, I would say that the question/answer you linked are the answer for this question. I likely saw the issue only when using the system() function in script because I usually use gvim and not vim. while troubleshooting, I did see the "strange" characters in the status line as that person mentioned when I tested stuff using just vim. Nov 6, 2020 at 15:11

0

Browse other questions tagged or ask your own question.