<story><title>ZSH, tmux, Emacs and SSH: A copy-paste story</title><url>https://blog.d46.us/zsh-tmux-emacs-copy-paste/</url></story><parent_chain></parent_chain><comment><author>dangirsh</author><text>This annoyance is one reason I avoid leaving Emacs. Eshell, tramp, dired, proced, docker-mode, etc...  replace most of my terminal needs (including SSH). The same movement, search, and copy&amp;#x2F;paste bindings work everywhere, including in buffers pointing to remote machines.&lt;p&gt;Relevant: &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;www.reddit.com&amp;#x2F;r&amp;#x2F;emacs&amp;#x2F;comments&amp;#x2F;6y3q4k&amp;#x2F;yes_eshell_is_my_main_shell&amp;#x2F;&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;www.reddit.com&amp;#x2F;r&amp;#x2F;emacs&amp;#x2F;comments&amp;#x2F;6y3q4k&amp;#x2F;yes_eshell_is...&lt;/a&gt;</text></comment>
<story><title>ZSH, tmux, Emacs and SSH: A copy-paste story</title><url>https://blog.d46.us/zsh-tmux-emacs-copy-paste/</url></story><parent_chain></parent_chain><comment><author>ackyshake</author><text>&lt;p&gt;&lt;pre&gt;&lt;code&gt;    &amp;gt; The problem is that pbpaste and pbcopy do not work under tmux
&lt;/code&gt;&lt;/pre&gt;
They do in recent macOS&amp;#x2F;tmux versions. You don&amp;#x27;t need reattach-to-user-namespace anymore.&lt;p&gt;These are my keybindings for copy&amp;#x2F;paste to clipboard:&lt;p&gt;&lt;pre&gt;&lt;code&gt;    bind-key -T copy-mode-vi &amp;#x27;v&amp;#x27; send -X begin-selection
    bind-key -T copy-mode-vi &amp;#x27;y&amp;#x27; send -X copy-pipe-and-cancel pbcopy
    bind-key -T copy-mode-vi MouseDragEnd1Pane send -X copy-pipe-and-cancel pbcopy
    bind-key -T copy-mode-vi MouseDragEnd3Pane send -X copy-pipe-and-cancel pbcopy
&lt;/code&gt;&lt;/pre&gt;
`prefix + ]` then pastes using the clipboard contents</text></comment>