Thanks very much for the reply.
It turns out that it does and you can. I've always left it set to
xterm-256color for the usual reason that "everything" knows how to
talk to an xterm-256color terminal.
I set TERM to mintty and the problem disappears.
> Since $TERM includes "xterm" Vim assumes the terminal behaves like an
> xterm and will enable modifyOtherKeys level 2. This should be harmless
> if the terminal advertises to be working like xterm but doesn't actually
> support it.
>
> I assume that mintty can't handle the escape sequences that do work for
> xterm. To find out which one please use a log:
>
> vim -N -u NONE -i NONE --log logfile --cmd 'set bg&'
>
> Around where you type the edit command you should be able to find some
> "raw key input:" and "raw terminal output:" lines that hopefully provide
> more information.
I did that with TERM=xterm-256color and TERM=mintty and used vimdiff
to compare the two logfiles. I found the offending escape sequence,
but I don't know what it means.
When TERM=xterm-256color, at the end of the "raw terminal output:"
line that prints the introductory message is the sequence
^[[?4m
I looked in the xterm source, in the file ctlseqs.txt, but could not
find that sequence, i.e., CSI ? ... m.
When I send that sequence from Vim to mintty with
:call echoraw("\e[?4m")
characters on the command line are printed in the tiny font.
I did a similar comparison between the logfiles with and without "-c
'set bg&'" argument. When that argument was _not_ present, the
logfile contained additional "raw terminal output:" lines that
presumably reset the font.
> You can also change the 'keyprotocol' option, e.g. make it empty, and
> see what effect that has.
Adding the argument
--cmd 'set keyprotocol='
or
-c 'set keyprotocol='
had no effect, whether set before or after bg&: the font on the
command line was always tiny.
So the correct solution is to set TERM=mintty. I'll do that and see
if anything else breaks, although I don't use that computer much for
my current work, so I won't notice anything for a while.
I would still like to know what that escape sequence is supposed to
do. If mintty's response seems to be a bug, then I'll report it to
the author.
Regards,
Gary