Monday, March 7, 2011

Re: Mystery vim7 versus vim6.4 - same term, different results

OK. Howard mentioned to me in an off-list message that the previous
problem I spotted was a red herring. He had been using a different
.viminfo filename but edited it out when posting results from the list
to hide the complexity.

As an aside, Howard, doing that kind of thing (editing debugging output)
is not recommended, unless absolutely necessary (e.g. to hide
passwords). It's so easy to accidentally edit out something significant,
incorrectly assuming it isn't important (and after all, if you knew for
certain what was important and what wasn't, you wouldn't need to ask the
list for help, right?).

>> I wonder if both are looking in the same place for terminfo stuff, and
>> for terminfo in the same format.
>
> I set TERMINFO to /etc/terminfo. I do not see how a different version of vim
> would ignore such a variable, and look in different directories for the
> terminfo file. I suppose, if vim could not read the format of this terminfo
> file (SunOS5.9), vim would use its builtins, which somehow could be different
> for different versions. Not sure how I would check this.

Well, I suppose there are a couple of things to try.

Both your Vim versions had nottybuiltin set, but it's worth checking the
builtin terminal descriptions don't in fact work! So try

:set ttybuiltin term=$TERM

and see if it helps. Try a few different :set term=whatever commands
AFTER SETTING ttybuiltin and see if any of them improve matters. Vim's
builtin terminals exist precisely because terminfo is often a bit
broken, so this is definitely worth trying, particularly with xterm,
which I seem to recall you said your terminal was.

Note that it can be handy to press Control-L to redraw the screen if
things get a bit messy, too, while you're messing around with this
stuff.

If that doesn't help, I guess we have to explore the terminfo situation
further. I seem to recall you saying you don't have root privileges, so
I guess you can't be logged in as root, and therefore $TERMINFO should
indeed be honoured. However, I notice that Vim 6 is linked with
-ltermlib whereas Vim 7 is linked with -lncurses. This could be causing
the problem, particularly if the ncurses stuff that went along with the
ncurses library Vim 7 was linked with isn't installed on your system.
I'm sure terminfo stuff is theoretically compatible, but I'm not sure
how this works out practically....

Does the place where you got your Vim 7 binary from also supply binaries
for ncurses? Terminfo descriptions? Maybe they are better/different to
what the system has on it currently. Maybe installing that stuff in
~/.terminfo would be worth a try.

>> Do both Vims show the same thing for :set term
>
> yes, for me term and TERM are set to xterm in the t shell, and vim's
> term is xterm to.

Does it work or not for you in this configuration? Is it only your blind
friend's ancient setup that is broken, or is yours broken too?

> My blind friend on the same machine, logs in using an ancient IBM PC
> type monitor. In that case, vim 6.4 can handle the monitor, but vim
> 7.3 seems to honor no setting that displays the screen correctly. We
> have tried pckerm, vt100, vt102, dumb etc. - nothing works.

Do they all fail the same way, or do they all fail differently? That
might help us determine whether anything terminal-related is happening
at all or not.

How does he log in? Telnet? SSH? A direct tty line? How is his $TERM
set?

Another interesting difference between your Vim versions is that Vim 7
is compiled with +multi_byte, but Vim 6 without it. This might mean that
Vim 7 is taking more notice of your locale settings than Vim 6 was,
and/or has 'enc' or 'tenc' set to something wrong or that your friend's
old terminal can't understand. What is 'enc' set to in both versions?
What about 'tenc'? Do things change/improve if you change particularly
'tenc', e.g. to utf-8 or latin1.

>> You will then have the output of :version and :set captured in a buffer.
>> Write that to a file somewhere, for each version, and then send both to
>> the list.

Getting to the desperate stage (which we surely are now!) maybe we can
just set the termcap entries manually! First thing to do is compare
them. Making sure you're using your friend's terminal, do the :redir
thing to capture the output of :set termcap for Vim 6 and then construct
a .vimrc file that sets them all manually (probably within an :if that
checks the $TERM variable, so it only does it for that terminal). I
can't think of any reason that sledgehammer approach wouldn't work.
Beware that a lot of the sequences will have escape (^[) in them, so
you'll have to carefully copy that character, or insert it using Ctrl-V
<Esc> when constructing your .vimrc.

But hopefully one of the things above will shed some light on the issue.
If none of this helps, I'm running out of ideas and someone else will
have to chip in!

Ben.

--
You received this message from the "vim_use" 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

No comments: