Ssh – GVim compiled from source opened via SSH -X does not copy paste on selection

copy/pastesshvim

I'm using SSH (with -X specified) from a Ubuntu box to a RHEL4 box and running GVim. It opens as expected in my local X, but the copy and paste via select doesn't work. I cannot select text in GVim and paste in a local window, nor can I select text from a local window and paste in GVim. This works, however, when I SSH (with -X specified) to a different RHEL4 box.

Is there something I need to install on the remote machine?

EDIT:
I'm suspecting that it has something to do with the compile flags I used, but I don't have a clue which one. I've tried --enable-gnome-check and --enable-gtk2-check, since I'm running gnome on my local machine, but that did not resolve the issue.

EDIT: Running vim --version on both versions of vim shows many differences, the most notable being that the machine which has no issue is for the GTK GUI and the machine which does have an issue is for the X11-Motif GUI. I can't configure the problem box to use GTK though since I don't have everything I need installed.

EDIT

  • Thanks for the help so far, guys.
  • To clarify, copy/paste via select
    works on a GVim window spawned from
    box A, but not on a GVim window
    spawned from box B. Both box A and
    box B are RHEL4 U8.
  • When I select
    some text in the GVim window, I can
    paste it via right-click within that
    window, but I cannot paste it into
    anything running locally. When I
    select something locally, I can paste
    it locally but when I paste into the
    GVim window, it pastes the last thing
    selected in the GVim window, not the
    last thing selected locally.
  • Just to make it a bit freakier, sometimes I open a second GVim window from the same box, I can paste into that second window (though still not the first), but I still cannot select something in that window and paste it locally.
  • I get the same behaviour using Ctrl-Shift-C. Holding shift while selecting with the mouse prevents selecting. Ctrl-Shift-V starts block selection in vim, not pasting.
  • I am running Parcellite 0.9.2 on the local box, but closing it doesn't make the problem go away, and it is not interfering with the other box.

EDIT

  • The machine that is presenting the problem is a vitual machine running on VM Player.

EDIT

  • A co-worker that is also SSHing to a virtual RHES4 U8 box does not have the same issue but he used the stock vim install on the VM whereas myself and another co-worker with the problem compiled vim from source. Could there be a compile flag we need?
  • I tried installing VM tools on one of the VMs, but it had no effect on this issue.

EDIT

  • The .vimrc between my two boxes is the same, scp'ed over.

Best Answer

Turns out the problem was that vim on the remote was not compiled with GTK. This happened because the necessary package was not present on the remote box. Thus, even with the --enable-gtk2-check compile flag set, it was not actually including GTK.

To fix it, log on to the remote machine and:

  1. Install gtk2-devel,
  2. re-configure, re-make, & re-install vim

A co-worker figured this out eventually.

Related Question