{"id":133,"date":"2013-01-19T02:06:42","date_gmt":"2013-01-19T10:06:42","guid":{"rendered":"http:\/\/thomashahn.is-a-geek.com\/wordpress\/?p=133"},"modified":"2013-01-19T02:06:42","modified_gmt":"2013-01-19T10:06:42","slug":"make-tmux-sessions-behave-like-screen","status":"publish","type":"post","link":"https:\/\/www.gauntletwizard.net\/wordpress\/?p=133","title":{"rendered":"Make tmux sessions behave like screen"},"content":{"rendered":"<p>I&#8217;ve been using tmux for a while, because it&#8217;s got a couple cool advantages over screen, mostly in the areas of &#8220;readable code&#8221; and &#8220;not locking up&#8221;. What it fails at, however, is having an interface like screen; What I really liked about screen is that I could have a dozen terminal windows open and use screen as a tiling window manager; I could swap between windows at will with keypresses, having some windows in multiple locations, others nowhere to be seen, and re-arrange how I had with button-presses.<\/p>\n<p>&nbsp;<\/p>\n<p>The functionality can be replicated with a little known feature called &#8220;grouping&#8221;. When you create a new\u00a0<span style=\"text-decoration: underline;\">session<\/span>, you can specify the -t command to &#8220;group&#8221; it with an existing one. This session-group will share all windows, but unlike having just one attached session, switching which window is active does not switch it in all.<\/p>\n<p>&nbsp;<\/p>\n<p>I also wrote a quick script to automatically look for an existing session, and, if none are detached, create a new one.<\/p>\n<p><code><br \/>\ntmux ls |grep -v attached |grep -v daemon<br \/>\nif [ $? -ne 0 ]; then<br \/>\ntmux new-session -t master ;<br \/>\nelse<br \/>\ntmux attach;<br \/>\nfi<br \/>\n<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve been using tmux for a while, because it&#8217;s got a couple cool advantages over screen, mostly in the areas of &#8220;readable code&#8221; and &#8220;not locking up&#8221;. What it fails at, however, is having an interface like screen; What I really liked about screen is that I could have a dozen terminal windows open and &hellip; <a href=\"https:\/\/www.gauntletwizard.net\/wordpress\/?p=133\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Make tmux sessions behave like screen<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.gauntletwizard.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/133"}],"collection":[{"href":"https:\/\/www.gauntletwizard.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gauntletwizard.net\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gauntletwizard.net\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gauntletwizard.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=133"}],"version-history":[{"count":1,"href":"https:\/\/www.gauntletwizard.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/133\/revisions"}],"predecessor-version":[{"id":134,"href":"https:\/\/www.gauntletwizard.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/133\/revisions\/134"}],"wp:attachment":[{"href":"https:\/\/www.gauntletwizard.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=133"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gauntletwizard.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=133"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gauntletwizard.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=133"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}