21
9
I'd like to be able to copy and paste between native (Cocoa?) MacOS X apps and those running under Mac's internal X server.
Currently I can copy and paste independently. If I select text in an xterm window I can paste it back in any other X based window. Similarly, copying information outside X can be pasted into applications which are also outside X.
As an example, if I (in exactly this order):
- Copy (select using the mouse) "Copy using X selection" in an xterm window
- Copy (Edit | Copy) "Text in Firefox" in Firefox
- Paste (Shift Insert xmodmap) into nano I get "Copy using X selection"
- Paste (Edit | Paste) here I get -> Text in Firefox
- Paste in MacVIM (Edit | Paste) I get "Text in Firefox"
- Paste into /usr/bin/vim (non graphical) I get "Copy using X selection"
How do I enable "clipboard sharing" between X and Cocoa?
The xmodmap I am using to paste in X is:
xmodmap -e "keycode 84 = Insert"
where 84 is the numeric keypad's Enter key. So Shift Enter gives me paste.
Is this consistent across X applications? Are you trying it in plain
xterm
or similar, notvim
or something with its own buffers? Which version of OS X are you running? My clipboard is shared across Cocoa and X11 as expected in 10.5.7. – jtb – 2009-08-03T06:40:01.910Hey jtb, thanks for your help. I use vim and am familiar with the issues around using it's internal buffers. I normally cheat and switch into edit mode then paste from gvim (or MacVim's) edit menu. I've added some extra information to my post to clarify the other parts of your question. – kwutchak – 2009-08-03T06:59:35.483
Ah, thanks for the extra info. I'm seeing mostly what you describe although the paste in step 3 works (using middle click, I don't have Insert mapped). Command-C does seem to copy into the native clipboard if I have text selected in X11, but I see what you mean that using the native X copy/paste operations it's not properly synchronized. – jtb – 2009-08-03T07:24:42.520
For recent version of OSX (I use 10.12), the following works: https://stackoverflow.com/a/9525347/1353267
– Samveen – 2018-06-16T12:26:50.647