Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm on a Mac (OS 10.8.2) and I'd like to start using xterm as my default terminal, rather than Terminal.app. Unfortunately, I can't paste text into an xterm window, and this is something that I frequently want to do. When I try, it pastes strange characters rather than what I thought that I had in my clipboard. For example, if use the trackpad to highlight my username in the xterm command prompt (gregory) and then hit cmd+V to paste, the text <00f6> appears. If the text that I copied was from a web browser, then only ö appears (an umlauted 'o').

I have tried toggling all the settings in Pasteboard Preferences (enable syncing, update pasteboard when clipboard changes, update clipboard when pasteboard changes, update pasteboard immediately when new text is selected) and none of those settings appear to have any effect; certainly none have allowed me to paste.

The behavior that I want is the standard cmd+C to copy and cmd+V to paste, though I could accept alternative key bindings.

Can anyone here explain the behavior that I'm observing and recommend a solution?

share|improve this question
    
I can’t answer your question, but here are two hints: (1) Have you checked your xterm documentation carefully? I haven’t used xterm for several years, but I recall that it liked to use a mouse-click combination to paste, rather than a (something)+V combination. (2) Did you notice that ö (‘o’ umlaut) is U+00F6 (Unicode character 00F6)? Probably not a coincidence. –  Scott Dec 11 '12 at 17:18
    
It appears that the solution might involve creating a ~/.Xmodmap file, but short of figuring out out to do that without clobbering things unintentionally, I've found a word-around with the shell command pbpaste. –  pyrogerg Dec 16 '12 at 11:47
add comment

2 Answers

You need to middle-click to paste the contents of the OS X Pasteboard (as the X11 settings call it.) If you don't have a middle mouse button, turn on "Emulate three button mouse" in the X11 Preferences under the "Input" tab, along with "Enable syncing" and "Update PRIMARY when Pasteboard changes" under the "Pasteboard" tab. Then you can paste whatever you copied in the rest of Mac OS X by holding down Option and clicking.

If you want to use +V, you can put this line into your .Xdefaults file:

*VT100.translations: #override  Meta <KeyPress> V:  insert-selection(PRIMARY, CUT_BUFFER0) \n

Then make sure that "Update PRIMARY when Pasteboard changes" is enabled under the "Pasteboard" tab in X11 Preferences. You may need to ensure that you don't have anything in .Xmodmap (or elsewhere) changing relevant key mappings. To apply your new settings, either quit and restart X11, or run xrdb -merge ~/.Xdefaults and then open a new xterm.

Selecting text in xterm, and hitting +C to copy, should work, if you have turned on "Enable key equivalents under X11" under the "Input" tab, and "Update Pasteboard when CLIPBOARD changes" under the "Pasteboard" tab.

share|improve this answer
add comment

do you have a 3 key mouse? press the wheel key, it will paste the content of the clipboard to the cursor location.

share|improve this answer
    
I don't have a mouse, as I'm using a MacBook with its trackpad. –  pyrogerg Dec 16 '12 at 11:35
add comment

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.