<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>docs/config/lua/wezterm.mux/index.markdown - fork/wezterm @ termwiz-0.23.2</title>
<meta name="description" content="docs/config/lua/wezterm.mux/index.markdown in fork/wezterm at termwiz-0.23.2.">
<meta property="og:title" content="docs/config/lua/wezterm.mux/index.markdown - fork/wezterm @ termwiz-0.23.2">
<meta property="og:description" content="docs/config/lua/wezterm.mux/index.markdown in fork/wezterm at termwiz-0.23.2.">
<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="termwiz-0.23.2" data-tip="8b7ca454b5e0a65b69b1b736db54eae3c195384b">
<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">Benoit de Chezelles</span><span class="commit-message" data-commit="f37c3ae5daaff27ecb885f4eed86ddb5784fdb59">Fix some documentation pages (#3321)</span><span class="snapshot-sha sha" data-commit="f37c3ae5daaff27ecb885f4eed86ddb5784fdb59">f37c3ae5d</span><time datetime="2023-03-22T14:36:03+01:00" title="2023-03-22 14:36:03 +0100">2023-03-22</time></p>
<header class="topbar"><details class="switcher"><summary>termwiz-0.23.2</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 class="current" 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 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/termwiz-0.23.2/tree/docs/">docs</a> / <a href="/fork/wezterm/ref/termwiz-0.23.2/tree/docs/config/">config</a> / <a href="/fork/wezterm/ref/termwiz-0.23.2/tree/docs/config/lua/">lua</a> / <a href="/fork/wezterm/ref/termwiz-0.23.2/tree/docs/config/lua/wezterm.mux/">wezterm.mux</a> / <span class="cur">index.markdown</span></nav>
<span class="view-stats"><span>1013 B</span><span>29 lines</span></span><span class="actions"><a class="raw" href="/fork/wezterm/raw/8c61f88154c420e6ce20e3de101f8c9fc5249c7c/docs/config/lua/wezterm.mux/index.markdown">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><code>wezterm.mux</code> module</h1>
<p>{{since('20220624-141144-bd1b7c5d')}}</p>
<p>The <code>wezterm.mux</code> module exposes functions that operate on the multiplexer layer.</p>
<p>The multiplexer manages the set of running programs into panes, tabs, windows
and workspaces.</p>
<p>The multiplexer may not be connected to a GUI so certain operations that require
a running Window management system are not present in the interface exposed
by this module.</p>
<p>You will typically use something like:</p>
<pre class="language-lua"><a-k>local</a-k> <a-v>wezterm</a-v> = <a-f>require</a-f> <a-s>&#39;wezterm&#39;</a-s>
<a-k>local</a-k> <a-v>mux</a-v> = <a-v>wezterm</a-v><a-p>.</a-p><a-v>mux</a-v></pre>
<p>at the top of your configuration file to access it.</p>
<h2>Important Note!</h2>
<p><em>You should <strong>avoid using, at the file scope in your config</strong>, mux functions that cause new splits, tabs or windows to be created. The configuration file can be evaluated multiple times in various contexts. If you want to spawn new programs when wezterm starts up, look at the <a href="/fork/wezterm/ref/termwiz-0.23.2/blob/docs/config/lua/gui-events/gui-startup.md">gui-startup</a> and <a href="/fork/wezterm/ref/termwiz-0.23.2/blob/docs/config/lua/mux-events/mux-startup.md">mux-startup</a> events.</em></p>
<h2>Available functions, constants</h2>
</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>`wezterm.mux` module</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">{{since(&#39;20220624-141144-bd1b7c5d&#39;)}}</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L4" href="#L4">4</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L5" href="#L5">5</a><span class="code-text">The `wezterm.mux` module exposes functions that operate on the multiplexer layer.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L6" href="#L6">6</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L7" href="#L7">7</a><span class="code-text">The multiplexer manages the set of running programs into panes, tabs, windows</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L8" href="#L8">8</a><span class="code-text">and workspaces.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L9" href="#L9">9</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L10" href="#L10">10</a><span class="code-text">The multiplexer may not be connected to a GUI so certain operations that require</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L11" href="#L11">11</a><span class="code-text">a running Window management system are not present in the interface exposed</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L12" href="#L12">12</a><span class="code-text">by this module.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L13" href="#L13">13</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L14" href="#L14">14</a><span class="code-text">You will typically use something like:</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L15" href="#L15">15</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L16" href="#L16">16</a><span class="code-text"><a-p>```</a-p><a-tl>lua</a-tl></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L17" href="#L17">17</a><span class="code-text"><a-p>local </a-p><a-v>wezterm</a-v><a-p> = </a-p><a-f>require</a-f><a-p> </a-p><a-s>&#39;wezterm&#39;</a-s></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L18" href="#L18">18</a><span class="code-text"><a-p>local </a-p><a-v>mux</a-v><a-p> = </a-p><a-v>wezterm</a-v><a-p>.</a-p><a-v>mux</a-v></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L19" href="#L19">19</a><span class="code-text"><a-p>```</a-p></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"><a-p>at the top of your configuration file to access it.</a-p></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><a-tt>Important Note!</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L24" href="#L24">24</a><span class="code-text"></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>*You should **avoid using, at the file scope in your config**, mux functions that cause new splits, tabs or windows to be created. The configuration file can be evaluated multiple times in various contexts. If you want to spawn new programs when wezterm starts up, look at the [gui-startup](../gui-events/gui-startup.md) and [mux-startup](../mux-events/mux-startup.md) events.*</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L26" href="#L26">26</a><span class="code-text"></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><a-tt>Available functions, constants</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L28" href="#L28">28</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L29" href="#L29">29</a><span class="code-text"></span></span></pre></div></div>
</main>
</body>
</html>
