{"id":344,"date":"2015-06-05T14:05:44","date_gmt":"2015-06-05T21:05:44","guid":{"rendered":"http:\/\/infinitedisorder.com\/?p=344"},"modified":"2015-12-01T16:28:58","modified_gmt":"2015-12-01T23:28:58","slug":"a-better-way-to-paste-from-a-tmux-remote-console-to-osx","status":"publish","type":"post","link":"https:\/\/infinitedisorder.com\/?p=344","title":{"rendered":"A bETTER way to paste from a tmux remote console to osx"},"content":{"rendered":"<p>I finally came up with\u00a0the way I always wanted this to work. Here is my\u00a0workflow:<\/p>\n<p>1. I run a command in a tmux pane to copy the entire buffer history of that pane.<br \/>\n2. Sublime Text pops open with the text from that buffer, I can edit the text and copy whatever I need to share with others.<\/p>\n<p>=========================================<br \/>\nPrerequisites: have dropbox running on wherever tmux is running (yes dropbox does work without a gui).<\/p>\n<p>1. First off, my tmux.conf:<\/p>\n<p>bind-key p command-prompt -p &#8216;save to file:&#8217; -I &#8216;~\/Dropbox\/tmux\/tmux.history.txt&#8217; &#8216;capture-pane -S -32768 ; save-buffer %1 ; delete-buffer&#8217;<\/p>\n<p>2. Now let&#8217;s run a launchctl to monitor the folder and open it in sublime text. Change USERNAME to your username (I&#8217;ll fix that in 2.0).<\/p>\n<p>vi ~\/Library\/LaunchAgents\/tmux.plist<\/p>\n<pre>\r\n<code>&lt;?xml version=\u201d1.0\u2033 encoding=\u201dUTF-8\u2033?&gt;\r\n&lt;!DOCTYPE plist PUBLIC \u201c-\/\/Apple Computer\/\/DTD PLIST 1.0\/\/EN\u201d\r\n\u201chttp:\/\/www.apple.com\/DTDs\/PropertyList-1.0.dtd\u201d&gt;\r\n&lt;plist version=\u201d1.0\u2033&gt;\r\n&lt;dict&gt;\r\n&lt;key&gt;Label&lt;\/key&gt;\r\n&lt;string&gt;FolderActions&lt;\/string&gt;\r\n&lt;key&gt;ProgramArguments&lt;\/key&gt;\r\n&lt;array&gt;\r\n&lt;string&gt;\/usr\/bin\/open&lt;\/string&gt;\r\n&lt;string&gt;-a&lt;\/string&gt;\r\n&lt;string&gt;Sublime Text&lt;\/string&gt;\r\n&lt;string&gt;\/Users\/bsmith\/Dropbox\/tmux\/tmux.history.txt&lt;\/string&gt;\r\n&lt;\/array&gt;\r\n&lt;key&gt;WatchPaths&lt;\/key&gt;\r\n&lt;array&gt;\r\n&lt;string&gt;\/Users\/bsmith\/Dropbox\/tmux&lt;\/string&gt;\r\n&lt;\/array&gt;\r\n&lt;\/dict&gt;\r\n&lt;\/plist&gt;<\/code>\r\n<\/pre>\n<p>3. launchctl load ~\/Library\/LaunchAgents\/tmux.plist<br \/>\n4. Test it by launching tmux on your remote server, control-b -&gt; p -&gt; return<br \/>\n5. If everything went well, your sublime text should open with your tmux history automagically.<br \/>\n6. A nice trick to go to the bottom in sublime text command &#8211; &lt;down arrow&gt;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I finally came up with\u00a0the way I always wanted this to work. Here is my\u00a0workflow: 1. I run a command in a tmux pane to copy the entire buffer history of that pane. 2. Sublime Text pops open with the text from that buffer, I can edit the text and copy whatever I need to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-344","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/infinitedisorder.com\/index.php?rest_route=\/wp\/v2\/posts\/344","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/infinitedisorder.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/infinitedisorder.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/infinitedisorder.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/infinitedisorder.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=344"}],"version-history":[{"count":5,"href":"https:\/\/infinitedisorder.com\/index.php?rest_route=\/wp\/v2\/posts\/344\/revisions"}],"predecessor-version":[{"id":401,"href":"https:\/\/infinitedisorder.com\/index.php?rest_route=\/wp\/v2\/posts\/344\/revisions\/401"}],"wp:attachment":[{"href":"https:\/\/infinitedisorder.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=344"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/infinitedisorder.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=344"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/infinitedisorder.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=344"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}