This question already has an answer here:

When I have two buffers open side by side in as terminal (as shown in the screenshot), I cannot simply select text in a single buffer for copy and paste purpose. The selection will span across them, which is expected because it is how the terminal works.

enter image description here

My question is: is it possible to copy the text via Crtl-space and then put it in OSX's clip broad? (e.g. pipe the selected text to pbcopy?)

marked as duplicate by Jordon Biondo, Scott Weldon, Dan Jun 15 '15 at 17:21

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


You could use shell-command-on-region to send the region's text to pbcopy.

(defun osx-copy-to-clipboard (beg end)
  (interactive "r")
  (message (if (zerop (shell-command-on-region beg end "pbcopy")) "copied" "copy failed")))

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