Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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.
share|improve this question
    
Let's make it a little clearer, are you saying, using the same command, the problem only happens with that computer and not with other computers? –  phunehehe Nov 18 '10 at 15:49
    
@phunehehe, Correct, 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. –  Robert Gowland Nov 18 '10 at 16:36

3 Answers 3

up vote 2 down vote accepted

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.

share|improve this answer

Just some thoughts without actually testing. If you are using the shell to launch your ssh session, you can use Ctrl-Shift-c and Ctrl-Shift-v to paste. Otherwise, would a right-click on your selection propose 'copy' to you?

share|improve this answer
    
thanks, but this is not the issue. I've updated the question with further detail. –  Robert Gowland Dec 3 '10 at 14:08

One thing that I would try is to make sure that you actually let X handle the selection. If you have set mouse=a in your vimrc file then vim will interpret the selection as its visual mode. If this is the case, try holding Shift when selecting.

Your terminal emulator may have its own mechanism for copying and pasting, for example gnome-terminal uses Ctrl Shift c for copying and Ctrl Shift v for pasting (as Morlock stated in his answer). You can use that instead.

share|improve this answer
    
thanks, but the vimrc between the two is the same. –  Robert Gowland Dec 3 '10 at 14:11

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.