Wednesday, May 2, 2012

Re: vim says "No protocol specified" and I have no idea what it means

On 05/02/12 08:30, Kevin O'Gorman wrote:
> The main symptoms are the message "No protocol specified" which
> appears both on the editing session (with a different background) and
> on the command-line.
>
> For instance, this is cut-and-pasted directly from my terminal session:
>
> root@treat:~/scripts# vim -i NONE -u NONE err
> No protocol specified
> No protocol specified
> No protocol specified
> root@treat:~/scripts#

I believe this is Vim trying to talk to your X server and failing.
I suspect you're running X as non-root and then "su"'ed to root. A
couple options exist depending on the solution you want:

1) try starting Vim with "-X" to tell vim not to bother connecting
to the X server. It's fast, easy, and reliable, but loses the
ability for root to use the X clipboards

2) link the ~user/.Xauthority to ~root/.Xauthority with

ln -s ~user/.Xauthority ~root/.Xauthority

This will give Vim-as-root the ability to talk to the X session. It
has the small downside that, if you have multiple users logging into
the machine, and you sit down arbitrarily at one of them (rather
than always logging in as the same user), you'd have to relink the
file each time (easily done by using "-f" and changing the username
from "user" to "user2"). This is the solution I use on my Debian
boxes at home.

3) blithely ignore the warning secure in knowing that it's only
telling you that Vim-as-root can't talk to the X server.

> The same phrase seems to appear randomly over the editing session.

Subsequent messages (after startup) _might_ occur under situations I
can't readily confirm without reading the source or a good bit of
experimentation, but I'd suspect that efforts to read/write from the
clipboard registers ("+" and "*"), or perhaps losing and regaining
focus might be possible candidates. However, #1 or #2 above should
resolve the issue.

-tim




--
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: