A vim clipboard problem

For some time I found pasting into vim from GTK2 applications (like firefox) really slow. When this performance bug happened the source application hung for several seconds until the text finally appeared within vim. This was with vim 7.0.

I searched for this problem a lot and didn’t find it discussed or a solution, so I assume it is a fairly obscure problem.

The bug only occured when running vim in a terminal; the GTK2 driven gvim always worked fine. Unfortunately I run vim in a terminal a lot.

At one time I found that by using gnome-terminal the problem went away. Although I couldn’t specify --disable-factory and --sm-disable as I liked to back in the days when gnome-terminal wasn’t stable enough to trust any sort of cooperation amongst terminals. Then I got the problem again even with Gnome terminal. Sometimes I would just have problems when pasting from QT apps (like konqueror) when pasting into vim in a gnome-terminal.

The whole experience was very frustrating and difficult to debug. Now the problem seems to be fixed, at least for the combination of packages that comes with Ubuntu Hardy. I never worked out why though.