unwanted escape sequences

16 views
Skip to first unread message

Charles Campbell

unread,
Nov 2, 2020, 7:36:07 PM11/2/20
to vim...@googlegroups.com
Hello!

Recently, as in the last year or so, I've been getting unwanted escape sequences; I've tracked down the issue to a simple operation:

vim -u NONE -U NONE
:q

and I get left with <esc>>4;m<esc>>4;2m.  My system uses linux (Scientific Linux 7.9), xterm-256color, and terminfo. In using infotmp xterm-256color I do not find any escape sequences using that format. There are three that are close:
is2=\E[!p\E[?3;4l\E[4l\E>
rmkx=\E[?1l\E>
rs2=\E[!p\E[?3;4l\E[4l\E>
(ie. these are the only places in the infocmp output that show \E> anywhere).

These unwanted escape sequences are normally just annoying, but they have bothered some scripts I've written (bothered = as in caused to fail).

Regards,
Chip Campbell

Gary Johnson

unread,
Nov 2, 2020, 8:03:06 PM11/2/20
to vim...@googlegroups.com
Those would be the modifyOtherKeys escape sequences supported by
some terminals including xterm. You can read about them here:

:help modifyOtherKeys

or with

:helpgrep \cmodifyotherkeys
:helpgrep t_TI

If your terminal doesn't support them, you should be able to
suppress Vim's use of them with these:

:set t_TI=
:set t_TE=

Not all of the terminals I use support them, but xterm version 344
does.

Regards,
Gary

Dominique Pellé

unread,
Nov 3, 2020, 12:19:11 AM11/3/20
to vim_dev
I had the same problem with at least xfce4-terminal or gnome-terminal
in Ubuntu-18.04. Adding this at the beginning of ~/.vimrc works around it:

" Work around spurious characters in old terminals when doing :!date
set t_TE= t_TI=

The work around is not needed anymore in Ubuntu-20.04.

Regards
Dominique

Bram Moolenaar

unread,
Nov 3, 2020, 12:03:12 PM11/3/20
to vim...@googlegroups.com, Dominique Pellé
It's a bug in some terminal implementations, they should ignore the
escape sequence but don't. Getting a newer version usually fixes it.

If you use "-u NONE" then the vimrc won't be used, but I suppose you
were only doing that for testing.

--
hundred-and-one symptoms of being an internet addict:
184. You no longer ask prospective dates what their sign is, instead
your line is "Hi, what's your URL?"

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages