[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[workaround] vi trying to connect to X


When I "su" to root and start "vi", a bunch of these messages appear:
Xlib: Invalid MIT-MAGIC-COOKIE-1 key
Xlib: connection to ":0.0" refused by server

Chris Howie explained:
> vim tries to connect X for access to the X clipboard.
> :help x11-selection

I think this is not a clever thing to do. Obviously, when I enter 'vi' in 
a shell, I do not want to use the X11 GUI in any way. If I wanted to, I'd 
enter 'gvim'.

This problem only appears when I "su" to root. To fix it, I created a vim 
configuration file /root/.vimrc containing the following line:
set clipboard=exclude:.*

As described in :help options, this has the same effect as using the -X 
argument on the command line (which fixes this problem, too).

Daniel Kabs
Refactor, don't archive! - SamHasler - 28 Aug 2004 - twiki.org 

Reply to: