1

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?)

Anthony Kong
  • 485
  • 3
  • 17

1 Answers1

0

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")))
Jordon Biondo
  • 12,332
  • 2
  • 41
  • 62