On Thursday, 7 January 2021 at 16:59:18 UTC Bram Moolenaar wrote:

>
> Dominique wrote: 
>
> > I recall that for recent vim, terminals such as xfce4-terminal 
> > and gnome-terminal (maybe others) in Ubuntu-18.04 are too 
> > old and Vim can output spurious codes on the terminal, 
> > It hapens for example when doing :!date 
> > Ubuntu-20.04 does not have this issue (newer terminals). 
> > There is a workaround: for old terminals: add the following 
> > lines at the beginning of your ~/.vimrc: 
> > 
> > " Work around spurious characters in old terminals when doing :!date 
> > set t_TE= t_TI= 
>
> I would not call them "old terminals", but newish terminals with bugs. 
> Old terminals just ignore codes that are not recognized. These newish 
> terminals had bugs that got fixed at some point, so perhaps you call the 
> version with a bug old? 
>

You're right in that I'm using an XFCE environment -- with xfce4-terminal 
0.8.7.4. It's annoying to hear that gnome-terminal has the same bug, that 
was the next thing I was going to try!
Xterm also seems to have the issue, but not as repeatably as xfce4-terminal.

I updated to Jonathon's latest Vim 8.2 package from the PPA -- according to 
:version, this is "Included patches: 1-2306".

After five tries opening a small Python file with Vim + syntastic (and 
Dominique's workaround in my vimrc), it displayed this stream of garbage on 
the top line:

^[P1$r2 q^[\^[[?12;2$y

In xfce4-terminal it's much worse:

^[[2;2R^[[3;6R^[[>1;5202;0c^[]10;rgb:ffff/ffff/ffff^G^[]11;rgb:0000/0000/0000^G

Shelling out to an external application seems to be the smoking gun - 
Syntastic starts up a Python linter when a file is opened or saved.

I had no issues with gvim.

Here's the small Python file I used:

addr = 0x10d8
while (addr & 0xFF00) != 0x0C00:
    print(hex(addr))
    addr -= 4

 

> Anyway, patch 8.2.2307 attempts to fix the problem for when a shell 
> command is used before Vim has started up. I hope there are no side 
> effects, we'll have to see. 
>

I'll see if I can pull down a later version of Vim with the 2307 patch, and 
build from source (perhaps with a few fewer addons!). Hopefully I can at 
least report back as to whether the bug is fixed.
Otherwise it seems like I'll be looking for a less buggy terminal 
emulator...

Thanks
Phil.
 

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/b6236b4a-e7c1-407c-9de3-a1d17925cc92n%40googlegroups.com.

Raspunde prin e-mail lui