<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>docs/recipes/workspaces.md - fork/wezterm @ vtparse-0.7.0</title>
<meta name="description" content="docs/recipes/workspaces.md in fork/wezterm at vtparse-0.7.0.">
<meta property="og:title" content="docs/recipes/workspaces.md - fork/wezterm @ vtparse-0.7.0">
<meta property="og:description" content="docs/recipes/workspaces.md in fork/wezterm at vtparse-0.7.0.">
<meta property="og:type" content="website">
<meta property="og:site_name" content="git.julia.blue">
<link rel="stylesheet" href="/css/style.css?v=62">
<script type="module" src="/js/main.js?v=62"></script>
</head>
<body>
<main data-ref="vtparse-0.7.0" data-tip="3bfe6df191af37bc33fe5fe6de12a40f7067f101">
<noscript>
  <div class="callout">
    <p>
      hey! this is a static git repo viewer. commit diffs, file history,
      older commits and other revisions won't load without javascript.
    </p>
    <p>
      you are still able to view source files on branch/tag tips,
      but the experience is degraded.
    </p>
  </div>
</noscript>
<header class="repo"><div>
<h1>fork/wezterm</h1>
</div>
<pre class="clone">git clone https://git.julia.blue/fork/wezterm</pre>
</header>
<p class="snapshot-commit"><span class="commit-author">Andrii</span><span class="commit-message" data-commit="fed9893a09c899f8115a52f76f0d4c006a7f241e">Update workspaces.md</span><span class="snapshot-sha sha" data-commit="fed9893a09c899f8115a52f76f0d4c006a7f241e">fed9893a0</span><time datetime="2023-12-06T13:33:56+01:00" title="2023-12-06 13:33:56 +0100">2023-12-06</time></p>
<header class="topbar"><details class="switcher"><summary>vtparse-0.7.0</summary><div class="menu"><strong>branches</strong><a href="/fork/wezterm/ref/main/">main</a><strong>tags</strong><a href="/fork/wezterm/ref/termiz-0.23.1/">termiz-0.23.1</a><a href="/fork/wezterm/ref/termiz-0.23.2/">termiz-0.23.2</a><a href="/fork/wezterm/ref/termiz-0.23.3/">termiz-0.23.3</a><a href="/fork/wezterm/ref/termwiz-0.23.0/">termwiz-0.23.0</a><a href="/fork/wezterm/ref/termwiz-0.23.1/">termwiz-0.23.1</a><a href="/fork/wezterm/ref/termwiz-0.23.2/">termwiz-0.23.2</a><a href="/fork/wezterm/ref/termwiz-0.23.3/">termwiz-0.23.3</a><a class="current" href="/fork/wezterm/ref/vtparse-0.7.0/">vtparse-0.7.0</a><a class="all" href="/fork/wezterm/refs">all refs →</a></div></details><nav class="crumbs"><a href="/fork/wezterm/">wezterm</a> / <a href="/fork/wezterm/ref/vtparse-0.7.0/tree/docs/">docs</a> / <a href="/fork/wezterm/ref/vtparse-0.7.0/tree/docs/recipes/">recipes</a> / <span class="cur">workspaces.md</span></nav>
<span class="view-stats"><span>1.6 KiB</span><span>36 lines</span></span><span class="actions"><a class="raw" href="/fork/wezterm/raw/f7736b6c43d94779b093e64f62e4df92bc52257d/docs/recipes/workspaces.md">raw</a></span></header>
<div class="markdown-view"><input type="radio" name="markdown-view" id="markdown-rendered" checked><label for="markdown-rendered">rendered</label><input type="radio" name="markdown-view" id="markdown-code"><label for="markdown-code">code</label><section class="readme rendered"><h1>Workspaces / Sessions</h1>
<p>If you are familiar with tmux then you may have used its session functionality
to manage separate groups of related tmux windows (which map to tabs in wezterm).</p>
<p>wezterm doesn't have an exact match to tmux sessions, but does have a similar
concept known as <em>Workspaces</em>.</p>
<p>Every <a href="../config/lua/mux-window/index.md">MuxWindow</a> is associated with a
workspace, which is just a label.</p>
<p>The wezterm GUI is focused on the active workspace, which means that it will
present a GUI window for each MuxWindow that is present in that workspace.</p>
<p>You can spawn windows into differently named workspaces and they won't become
visible until you set the active workspace to that name.</p>
<p>When switching the active workspace, wezterm will swap the contents of the
GUI windows with the MuxWindows that belong to the now-focused workspace.</p>
<p>The following key assignments are helpful when working with workspaces:</p>
<ul>
<li><a href="/fork/wezterm/ref/vtparse-0.7.0/blob/docs/config/lua/keyassignment/SwitchToWorkspace.md">SwitchToWorkspace</a></li>
<li><a href="/fork/wezterm/ref/vtparse-0.7.0/blob/docs/config/lua/keyassignment/SwitchWorkspaceRelative.md">SwitchWorkspaceRelative</a></li>
<li>Various key assignments or functions that spawn windows also allow specifying
the workspace name to be used</li>
<li><a href="/fork/wezterm/ref/vtparse-0.7.0/blob/docs/config/lua/keyassignment/ShowLauncher.md">ShowLauncher</a> and
<a href="/fork/wezterm/ref/vtparse-0.7.0/blob/docs/config/lua/keyassignment/ShowLauncherArgs.md">ShowLauncherArgs</a> will list
the current set of workspaces and allow switching between them</li>
</ul>
<p>You can pre-define a layout of windows/tabs/panes in specific workspaces by
using these events:</p>
<ul>
<li><a href="/fork/wezterm/ref/vtparse-0.7.0/blob/docs/config/lua/gui-events/gui-startup.md">gui-startup</a></li>
<li><a href="/fork/wezterm/ref/vtparse-0.7.0/blob/docs/config/lua/mux-events/mux-startup.md">mux-startup</a></li>
</ul>
</section><div class="code-panel"><pre class="code src language-markdown"><span class="code-line"><a class="ln" id="L1" href="#L1">1</a><span class="code-text"><a-p>#</a-p> <a-tt>Workspaces / Sessions</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L2" href="#L2">2</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L3" href="#L3">3</a><span class="code-text">If you are familiar with tmux then you may have used its session functionality</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L4" href="#L4">4</a><span class="code-text">to manage separate groups of related tmux windows (which map to tabs in wezterm).</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L5" href="#L5">5</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L6" href="#L6">6</a><span class="code-text">wezterm doesn&#39;t have an exact match to tmux sessions, but does have a similar</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L7" href="#L7">7</a><span class="code-text">concept known as *Workspaces*.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L8" href="#L8">8</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L9" href="#L9">9</a><span class="code-text">Every [MuxWindow](../config/lua/mux-window/index.md) is associated with a</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L10" href="#L10">10</a><span class="code-text">workspace, which is just a label.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L11" href="#L11">11</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L12" href="#L12">12</a><span class="code-text">The wezterm GUI is focused on the active workspace, which means that it will</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L13" href="#L13">13</a><span class="code-text">present a GUI window for each MuxWindow that is present in that workspace.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L14" href="#L14">14</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L15" href="#L15">15</a><span class="code-text">You can spawn windows into differently named workspaces and they won&#39;t become</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L16" href="#L16">16</a><span class="code-text">visible until you set the active workspace to that name.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L17" href="#L17">17</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L18" href="#L18">18</a><span class="code-text">When switching the active workspace, wezterm will swap the contents of the</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L19" href="#L19">19</a><span class="code-text">GUI windows with the MuxWindows that belong to the now-focused workspace.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L20" href="#L20">20</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L21" href="#L21">21</a><span class="code-text">The following key assignments are helpful when working with workspaces:</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L22" href="#L22">22</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L23" href="#L23">23</a><span class="code-text"><a-p>* </a-p>[SwitchToWorkspace](../config/lua/keyassignment/SwitchToWorkspace.md)</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L24" href="#L24">24</a><span class="code-text"><a-p>* </a-p>[SwitchWorkspaceRelative](../config/lua/keyassignment/SwitchWorkspaceRelative.md)</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L25" href="#L25">25</a><span class="code-text"><a-p>* </a-p>Various key assignments or functions that spawn windows also allow specifying</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L26" href="#L26">26</a><span class="code-text"><a-p>  </a-p>the workspace name to be used</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L27" href="#L27">27</a><span class="code-text"><a-p>* </a-p>[ShowLauncher](../config/lua/keyassignment/ShowLauncher.md) and</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L28" href="#L28">28</a><span class="code-text"><a-p>  </a-p>[ShowLauncherArgs](../config/lua/keyassignment/ShowLauncherArgs.md) will list</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L29" href="#L29">29</a><span class="code-text"><a-p>  </a-p>the current set of workspaces and allow switching between them</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L30" href="#L30">30</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L31" href="#L31">31</a><span class="code-text"><a-p>You can pre-define a layout of windows/tabs/panes in specific workspaces by</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L32" href="#L32">32</a><span class="code-text"><a-p>using these events:</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L33" href="#L33">33</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L34" href="#L34">34</a><span class="code-text"><a-p>* [gui-startup](../config/lua/gui-events/gui-startup.md)</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L35" href="#L35">35</a><span class="code-text"><a-p>* </a-p>[mux-startup](../config/lua/mux-events/mux-startup.md)</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L36" href="#L36">36</a><span class="code-text"></span></span></pre></div></div>
</main>
</body>
</html>
