Why does tmux not insert newlines when pasting a multi-line command?
I solved the problem. I had been using reattach-to-user-namespace
to interact with the OS X clipboard; however, according to the reattach-to-user-namespace
github page:
Note: Under Yosemite (and later) pasteboard access seems to work fine without the program from this repository.
I removed the set-option -g default-command "reattach-to-user-namespace -l bash"
line from my .tmux.conf
file. I also changed my tmux mapping to
bind -t vi-copy y copy-pipe "pbcopy"
and it copies text to the OS X clipboard from vi-copy mode as expected. Pasting text using the OS X default Cmd-v produces the expected behavior (like in screen or plain bash shell as described in the question). Thanks to @Alex Torok for prompting my config file debugging.