Skip to content

Latest commit

 

History

History
34 lines (24 loc) · 788 Bytes

clipboard_support.md

File metadata and controls

34 lines (24 loc) · 788 Bytes

Clipboard Support

For Mac, in order to use the clipboard across the host and the guest vagrant box, you must:

  1. Download and run XQuartz
  2. Forward X11 in your ssh connection:
  Host localhost
    ...
    ForwardX11 yes

or pass the -X flag to the ssh connection string

ssh user@host -X

Add Support for pbcopy and pbpaste

If you prefer to use pbcopy and pbpaste within the vagrant box just add the following to your shell config.

# .zshrc or .bashrc
alias pbcopy='xclip -selection clipboard'
alias pbpaste='xclip -selection clipboard -o'

Add Clipboard Support to Tmux

# .tmux.conf
if-shell "uname -n | grep vagrant" \
  'bind-key -t vi-copy Enter copy-pipe "xclip -in -selection clipboard"'