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?

  • 2
    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. Dec 11, 2012 at 17:18
  • 2
    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.
    – Gregory
    Dec 16, 2012 at 11:47
  • For recent version of OSX (I use 10.12), the following works: stackoverflow.com/a/9525347/1353267
    – Samveen
    Jun 16, 2018 at 12:28

4 Answers 4


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.

  • 6
    Yes, I have no middle mouse button on my track pad...
    – Michael
    Jul 28, 2017 at 18:29
  • 2
    @Michael Then go to XQuartz > Preferences > Input > Emulate three button mouse. Or you could install something like BetterTouchTool, which is a more general solution.
    – GDP2
    Oct 24, 2017 at 2:58

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

  • 7
    I don't have a mouse, as I'm using a MacBook with its trackpad.
    – Gregory
    Dec 16, 2012 at 11:35
  • 2
    @Gregory Then go to XQuarts > Preferences > Input > Emulate three button mouse. Or you could install something like BetterTouchTool, which is a more general solution.
    – GDP2
    Oct 24, 2017 at 3:00

Try running xrdb -merge ~/.Xdefaults as suggested by Kundor. Unlike restarting X11, xrdb required me to agree to the Xcode license agreement on my new El Capitan OS X 10.11 install. Once that was done, my .Xdefaults file was implemented properly and ⌘+V to paste in xterm was working again.


If you are accessing/running this from mac terminal to connect to windows this is what made it work nicely for me

xfreerdp --no-nla --plugin cliprdr -g 1600x1000 -u "your_user_name" your_server_or_ip 

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .