Skip to content

Instantly share code, notes, and snippets.

@kevsmith
Last active October 29, 2016 13:49
Show Gist options
  • Save kevsmith/9391287 to your computer and use it in GitHub Desktop.
Save kevsmith/9391287 to your computer and use it in GitHub Desktop.
osx_clipboard.el
(setq interprogram-cut-function
(lambda (text &optional push)
(let* ((process-connection-type nil)
(pbproxy (start-process "pbcopy" "pbcopy" "/usr/bin/pbcopy")))
(process-send-string pbproxy text)
(process-send-eof pbproxy))))
(setq interprogram-paste-function
(lambda ()
(shell-command-to-string "pbpaste")))
@daemianmack
Copy link

This is awesome, thank you!

I found the following additional bits necessary...

At shell prompt...

brew install reattach-to-user-namespace --wrap-pbcopy-and-pbpaste

Added to ~/.tmux.conf...

set-option -g default-command "reattach-to-user-namespace -l bash"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment