<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>DevMemo – tmux</title><link>https://devmemo.gitlab.io/categories/tmux/</link><description>Recent content in tmux on DevMemo</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="https://devmemo.gitlab.io/categories/tmux/index.xml" rel="self" type="application/rss+xml"/><item><title>Cheatsheets: Tmux Cheatsheet</title><link>https://devmemo.gitlab.io/cheatsheets/tmux/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://devmemo.gitlab.io/cheatsheets/tmux/</guid><description>
&lt;h2 id="commands">Commands&lt;/h2>
&lt;h3 id="session">Session&lt;/h3>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Start a new tmux session.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>tmux
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Start a new tmux session with name.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>tmux new -s &amp;lt;session-name&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># List all sessions.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>tmux ls
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Attach to the last session.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>tmux attach
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Attach to a session with name.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>tmux attach -t &amp;lt;session-name&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Kill a session.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>tmux kill-session -t &amp;lt;session-name&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Kill sessions other than the current one.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>tmux kill-session -a
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Kill sessions other than the named one.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>tmux kill-session -a -t &amp;lt;session-name&amp;gt;
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="window">Window&lt;/h3>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Create a new window and switch to it.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>tmux new-window
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Create a a new window with name, but do not swith to it.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>tmux new-window -t -n &amp;lt;window-name&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Kill the current window.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>tmux kill-window
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Kill the target window.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>tmux kill-window -t &amp;lt;window-name&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Send keys to the target window. (End with C-j for enter)&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>tmux send-keys -t &amp;lt;window-name&amp;gt; &amp;lt;command&amp;gt; C-j
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="info">Info&lt;/h3>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Show tmux session information.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>tmux info
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="config">Config&lt;/h3>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Reload config.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>tmux source-file ~/.tmux.conf
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Show config.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>tmux show-options -g
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="hotkeys">HotKeys&lt;/h2>
&lt;h3 id="session-management">Session Management&lt;/h3>
&lt;div class="sw-table-container dark-scrollbar">
&lt;table class="sw-headless-two-col-table" id="">
&lt;thead>
&lt;tr>
&lt;th>&lt;/th>
&lt;th style="text-align:right">&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>C-b d&lt;/code>&lt;/td>
&lt;td style="text-align:right">Dettach from session&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>C-b s&lt;/code>&lt;/td>
&lt;td style="text-align:right">Show all sessions&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>C-b $&lt;/code>&lt;/td>
&lt;td style="text-align:right">Rename sessions&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>C-b (&lt;/code>&lt;/td>
&lt;td style="text-align:right">Go to the previous session&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>C-b )&lt;/code>&lt;/td>
&lt;td style="text-align:right">Go to the next session&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;h3 id="window-management">Window Management&lt;/h3>
&lt;div class="sw-table-container dark-scrollbar">
&lt;table class="sw-headless-two-col-table" id="">
&lt;thead>
&lt;tr>
&lt;th>&lt;/th>
&lt;th style="text-align:right">&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>C-b c&lt;/code>&lt;/td>
&lt;td style="text-align:right">Create a new window&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>C-b p&lt;/code>&lt;/td>
&lt;td style="text-align:right">Go to the previous window&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>C-b n&lt;/code>&lt;/td>
&lt;td style="text-align:right">Go to the next window&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>C-b ,&lt;/code>&lt;/td>
&lt;td style="text-align:right">Rename window&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>C-b &amp;amp;&lt;/code>&lt;/td>
&lt;td style="text-align:right">Close window&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>C-b w&lt;/code>&lt;/td>
&lt;td style="text-align:right">List window&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>C-b f&lt;/code>&lt;/td>
&lt;td style="text-align:right">Find window&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>C-b l&lt;/code>&lt;/td>
&lt;td style="text-align:right">Last window&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>C-b .&lt;/code>&lt;/td>
&lt;td style="text-align:right">Move window&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>C-b 0...9&lt;/code>&lt;/td>
&lt;td style="text-align:right">Goto # window&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;h3 id="pane-management">Pane Management&lt;/h3>
&lt;div class="sw-table-container dark-scrollbar">
&lt;table class="sw-headless-two-col-table" id="">
&lt;thead>
&lt;tr>
&lt;th>&lt;/th>
&lt;th style="text-align:right">&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>C-b &amp;quot;&lt;/code>&lt;/td>
&lt;td style="text-align:right">Split horizontally&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>C-b %&lt;/code>&lt;/td>
&lt;td style="text-align:right">Split vertically&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>C-b !&lt;/code>&lt;/td>
&lt;td style="text-align:right">Convert pane to window&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>C-b x&lt;/code>&lt;/td>
&lt;td style="text-align:right">Kill pane&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>C-b &amp;lt;arrow&amp;gt;&lt;/code>&lt;/td>
&lt;td style="text-align:right">Switch panes&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>C-b C-&amp;lt;arrow&amp;gt;&lt;/code>&lt;/td>
&lt;td style="text-align:right">Adjust pane size&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>C-b &amp;lt;space&amp;gt;&lt;/code>&lt;/td>
&lt;td style="text-align:right">Toggle pane layout&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>C-b {/}&lt;/code>&lt;/td>
&lt;td style="text-align:right">Move to Left/Right&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>C-b o&lt;/code>&lt;/td>
&lt;td style="text-align:right">Goto next panes&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>C-b z&lt;/code>&lt;/td>
&lt;td style="text-align:right">toggle full-screen&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>C-b ;&lt;/code>&lt;/td>
&lt;td style="text-align:right">Toggle Last pane&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>C-b q&lt;/code>&lt;/td>
&lt;td style="text-align:right">Show numbers&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>C-b q 0...9&lt;/code>&lt;/td>
&lt;td style="text-align:right">Goto # pane&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div></description></item></channel></rss>