{"id":236,"date":"2020-09-15T11:22:46","date_gmt":"2020-09-15T09:22:46","guid":{"rendered":"https:\/\/pcmacsb.de\/?page_id=236"},"modified":"2025-12-26T11:12:35","modified_gmt":"2025-12-26T10:12:35","slug":"cheat-sheet-tmux","status":"publish","type":"page","link":"https:\/\/pcmacb.de\/?page_id=236","title":{"rendered":"tmux cheat sheet"},"content":{"rendered":"\n<ul class=\"wp-block-list\">\n<li>(C-x means ctrl+x, M-x means alt+x)<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Prefix key<\/strong><\/h4>\n\n\n\n<p>default prefix is C-b<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Config File<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>set -g mouse on\nset -g history-limit 50000\nset -g default-terminal \"screen-256color\"\n# display of active window\nset -g window-status-current-format '#{window_index}_#{b:pane_current_path}*'\n# display of all other windows\nset -g window-status-format '#{window_index}_#{b:pane_current_path}'\n#  make sure to update the window title every 5 seconds\nset -g status-interval 5\n# I und K um pane zu vergroessern\nbind -r K resize-pane -D 5\nbind -r I resize-pane -U 5<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Sessions, windows, panes<\/strong><\/h4>\n\n\n\n<p>Session is a set of windows, plus a notion of which window is current.<br>Window is a single screen covered with panes. (Once might compare it to a \u2018virtual desktop\u2019 or a \u2018space\u2019.)<br>Pane is a rectangular part of a window that runs a specific command, e.g. a shell.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Getting help<\/strong><\/h4>\n\n\n\n<p>C-b ?<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Managing sessions<\/strong><\/h2>\n\n\n\n<p>List Sessions: <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tmux list-sessions<\/code><\/pre>\n\n\n\n<p>Creating a session:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tmux new-session -s work<\/code><\/pre>\n\n\n\n<p>Create a new session that shares all windows with an existing session, but has its own separate notion of which window is current:<br>tmux new-session -s work2 -t work<\/p>\n\n\n\n<p>Attach to a session:<br>tmux attach -t work<\/p>\n\n\n\n<p>Detach from a session: C-b d.<\/p>\n\n\n\n<p>Switch between sessions:<br>C-b (&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; previous session<br>C-b )&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; next session<br>C-b L&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u2018last\u2019 (previously used) session<br>C-b s&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; choose a session from a list<\/p>\n\n\n\n<p>Other:<br>C-b $&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rename the current session<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Managing split panes<\/strong><\/h4>\n\n\n\n<p>C-b &#8220;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; split vertically (top\/bottom)<br>C-b %&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; split horizontally (left\/right)<\/p>\n\n\n\n<p>Switching between panes:<br>C-b left &nbsp; &nbsp; &nbsp; go to the next pane on the left<br>C-b right&nbsp; &nbsp; &nbsp; (or one of these other directions)<br>C-b up<br>C-b down<br>C-b o&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; go to the next pane (cycle through all of them)<br>C-b ;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; go to the \u2018last\u2019 (previously used) pane<\/p>\n\n\n\n<p>Resizing panes:<br>C-b C-up, C-b C-down, C-b C-left, C-b C-right<\/p>\n\n\n\n<p>Applying predefined layouts:<\/p>\n\n\n\n<p>C-b M-1&nbsp; &nbsp; &nbsp; &nbsp; switch to even-horizontal layout<br>C-b M-2&nbsp; &nbsp; &nbsp; &nbsp; switch to even-vertical layout<br>C-b M-3&nbsp; &nbsp; &nbsp; &nbsp; switch to main-horizontal layout<br>C-b M-4&nbsp; &nbsp; &nbsp; &nbsp; switch to main-vertical layout<br>C-b M-5&nbsp; &nbsp; &nbsp; &nbsp; switch to tiled layout<br>C-b space&nbsp; &nbsp; &nbsp; switch to the next layout<\/p>\n\n\n\n<p>Other:<br>C-b x&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; kill the current pane<br>C-b q&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; display pane numbers for a short while<\/p>\n\n\n\n<p>Moving panes around:<br>C-b {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; move the current pane to the previous position<br>C-b }&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; move the current pane to the next position<br>C-b C-o&nbsp; &nbsp; &nbsp; &nbsp; rotate window \u2018up\u2019 (i.e. move all panes)<br>C-b M-o&nbsp; &nbsp; &nbsp; &nbsp; rotate window \u2018down\u2019<br>C-b !&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; move the current pane into a new separate window (\u2018break pane\u2019)<br>C-b :move-pane -t :3.2&nbsp;&nbsp;&nbsp;&nbsp;split window 3&#8217;s pane 2 and move the current pane there<\/p>\n\n\n\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow\"><\/div><\/div>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Managing windows<\/strong><\/h4>\n\n\n\n<p>C-b c&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; create a new window<br>C-b 1 &#8230;&nbsp; &nbsp; &nbsp; switch to window 1, &#8230;, 9, 0<br>C-b 9<br>C-b 0<br>C-b p&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; previous window<br>C-b n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; next window<br>C-b l&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u2018last\u2019 (previously used) window<br>C-b w&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; choose window from a list<br>Switch between windows with a twist:<br>C-b M-n&nbsp; &nbsp; &nbsp; &nbsp; next window with a bell, activity or&nbsp;content alert<br>C-b M-p&nbsp; &nbsp; &nbsp; &nbsp; previous such window<br>C-b ,&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rename the current window<br>C-b &amp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; kill the current window<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><\/h4>\n\n\n\n<h4 class=\"wp-block-heading\">.tmux.conf im Userverzeichnis<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code># start with window 1 (instead of 0)\nset -g base-index 1<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Prefix key default prefix is C-b Config File Sessions, windows, panes Session is a set of windows, plus a notion of which window is current.Window is a single screen covered with panes. (Once might compare it to a \u2018virtual desktop\u2019 <a class=\"more-link\" href=\"https:\/\/pcmacb.de\/?page_id=236\">weiterlesen&#8230;<\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"parent":168,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_lmt_disableupdate":"","_lmt_disable":"","footnotes":""},"class_list":["post-236","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/pcmacb.de\/index.php?rest_route=\/wp\/v2\/pages\/236","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pcmacb.de\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/pcmacb.de\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/pcmacb.de\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/pcmacb.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=236"}],"version-history":[{"count":8,"href":"https:\/\/pcmacb.de\/index.php?rest_route=\/wp\/v2\/pages\/236\/revisions"}],"predecessor-version":[{"id":1449,"href":"https:\/\/pcmacb.de\/index.php?rest_route=\/wp\/v2\/pages\/236\/revisions\/1449"}],"up":[{"embeddable":true,"href":"https:\/\/pcmacb.de\/index.php?rest_route=\/wp\/v2\/pages\/168"}],"wp:attachment":[{"href":"https:\/\/pcmacb.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=236"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}