<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>docs/config/lua/config/window_padding.md - fork/wezterm @ termwiz-0.23.3</title>
<meta name="description" content="docs/config/lua/config/window_padding.md in fork/wezterm at termwiz-0.23.3.">
<meta property="og:title" content="docs/config/lua/config/window_padding.md - fork/wezterm @ termwiz-0.23.3">
<meta property="og:description" content="docs/config/lua/config/window_padding.md in fork/wezterm at termwiz-0.23.3.">
<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.3" data-tip="4bf28e253c0167102f07bfc7e7199c13eed98012">
<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">Benjamin Habié</span><span class="commit-message" data-commit="bc99181fa206f26222acf702648a98330bf0b2b8">docs: Fix typo</span><span class="snapshot-sha sha" data-commit="bc99181fa206f26222acf702648a98330bf0b2b8">bc99181fa</span><time datetime="2023-10-22T05:08:38+02:00" title="2023-10-22 05:08:38 +0200">2023-10-22</time></p>
<header class="topbar"><details class="switcher"><summary>termwiz-0.23.3</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 class="current" 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.3/tree/docs/">docs</a> / <a href="/fork/wezterm/ref/termwiz-0.23.3/tree/docs/config/">config</a> / <a href="/fork/wezterm/ref/termwiz-0.23.3/tree/docs/config/lua/">lua</a> / <a href="/fork/wezterm/ref/termwiz-0.23.3/tree/docs/config/lua/config/">config</a> / <span class="cur">window_padding.md</span></nav>
<span class="view-stats"><span>1.9 KiB</span><span>48 lines</span></span><span class="actions"><a class="raw" href="/fork/wezterm/raw/a1cc0a0daa39ac96adb1f9f658ce81529f9eee69/docs/config/lua/config/window_padding.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"><hr />
<p>tags:</p>
<ul>
<li>appearance</li>
</ul>
<hr />
<h1><code>window_padding</code></h1>
<p>Controls the amount of padding between the window border and the
terminal cells.</p>
<p>Padding is measured in pixels.</p>
<p>If <a href="/fork/wezterm/ref/termwiz-0.23.3/blob/docs/config/lua/config/enable_scroll_bar.md">enable_scroll_bar</a> is <code>true</code>, then the value you
set for <code>right</code> will control the width of the scrollbar.  If you have
enabled the scrollbar and have set <code>right</code> to <code>0</code> then the right padding
(and thus the scrollbar width) will instead match the width of a cell.</p>
<pre class="language-lua"><a-v>config</a-v><a-p>.</a-p><a-v>window_padding</a-v> = <a-cr>{</a-cr>
  <a-v>left</a-v> = <a-n>2</a-n><a-p>,</a-p>
  <a-v>right</a-v> = <a-n>2</a-n><a-p>,</a-p>
  <a-v>top</a-v> = <a-n>0</a-n><a-p>,</a-p>
  <a-v>bottom</a-v> = <a-n>0</a-n><a-p>,</a-p>
<a-cr>}</a-cr></pre>
<p>{{since('20211204-082213-a66c61ee9')}}</p>
<p>You may now express padding using a number of different units by specifying
a string value with a unit suffix:</p>
<ul>
<li><code>"1px"</code> - the <code>px</code> suffix indicates pixels, so this represents a <code>1</code> pixel value</li>
<li><code>"1pt"</code> - the <code>pt</code> suffix indicates points.  There are <code>72</code> points in <code>1 inch</code>.  The actual size this occupies on screen depends on the dpi of the display device.</li>
<li><code>"1cell"</code> - the <code>cell</code> suffix indicates the size of the terminal cell, which in turn depends on the font size, font scaling and dpi.  When used for width, the width of the cell is used.  When used for height, the height of the cell is used.</li>
<li><code>"1%"</code> - the <code>%</code> suffix indicates the size of the terminal portion of the display, which is computed based on the number of rows/columns and the size of the cell.  While it is possible to specify percentage, there are some resize scenarios where the percentage value may not be 100% stable/deterministic, as the size of the padding is used to compute the number of rows/columns.</li>
</ul>
<p>You may use a fractional number such as <code>"0.5cell"</code> or numbers larger than one such as <code>"72pt"</code>.</p>
<p>The default padding is shown below.  In earlier releases, the default padding was 0 for each of the possible edges.</p>
<pre class="language-lua"><a-v>config</a-v><a-p>.</a-p><a-v>window_padding</a-v> = <a-cr>{</a-cr>
  <a-v>left</a-v> = <a-s>&#39;1cell&#39;</a-s><a-p>,</a-p>
  <a-v>right</a-v> = <a-s>&#39;1cell&#39;</a-s><a-p>,</a-p>
  <a-v>top</a-v> = <a-s>&#39;0.5cell&#39;</a-s><a-p>,</a-p>
  <a-v>bottom</a-v> = <a-s>&#39;0.5cell&#39;</a-s><a-p>,</a-p>
<a-cr>}</a-cr></pre>
</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></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L2" href="#L2">2</a><span class="code-text"><a-pr>tags</a-pr><a-p>:</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L3" href="#L3">3</a><span class="code-text">  <a-p>-</a-p> <a-s>appearance</a-s></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L4" href="#L4">4</a><span class="code-text"><a-p>---</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L5" href="#L5">5</a><span class="code-text"><a-p>#</a-p> <a-tt>`window_padding`</a-tt></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">Controls the amount of padding between the window border and the</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L8" href="#L8">8</a><span class="code-text">terminal cells.</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">Padding is measured in pixels.</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">If [enable_scroll_bar](enable_scroll_bar.md) is `true`, then the value you</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L13" href="#L13">13</a><span class="code-text">set for `right` will control the width of the scrollbar.  If you have</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L14" href="#L14">14</a><span class="code-text">enabled the scrollbar and have set `right` to `0` then the right padding</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L15" href="#L15">15</a><span class="code-text">(and thus the scrollbar width) will instead match the width of a cell.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L16" href="#L16">16</a><span class="code-text"></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>```</a-p><a-tl>lua</a-tl></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>config.</a-p><a-v>window_padding</a-v><a-p> = </a-p><a-cr>{</a-cr></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><a-v>left</a-v><a-p> = </a-p><a-n>2</a-n><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"><a-p>  </a-p><a-v>right</a-v><a-p> = </a-p><a-n>2</a-n><a-p>,</a-p></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>  </a-p><a-v>top</a-v><a-p> = </a-p><a-n>0</a-n><a-p>,</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"><a-p>  </a-p><a-v>bottom</a-v><a-p> = </a-p><a-n>0</a-n><a-p>,</a-p></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></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></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L25" href="#L25">25</a><span class="code-text"></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>{{since(&#39;20211204-082213-a66c61ee9&#39;)}}</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L27" href="#L27">27</a><span class="code-text"></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>You may now express padding using a number of different units by specifying</a-p></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 string value with a unit suffix:</a-p></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>* `&quot;1px&quot;` - the `px` suffix indicates pixels, so this represents a `1` pixel value</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>* `&quot;1pt&quot;` - the `pt` suffix indicates points.  There are `72` points in `1 inch`.  The actual size this occupies on screen depends on the dpi of the display device.</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"><a-p>* `&quot;1cell&quot;` - the `cell` suffix indicates the size of the terminal cell, which in turn depends on the font size, font scaling and dpi.  When used for width, the width of the cell is used.  When used for height, the height of the cell is used.</a-p></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>* `&quot;1%&quot;` - the `%` suffix indicates the size of the terminal portion of the display, which is computed based on the number of rows/columns and the size of the cell.  While it is possible to specify percentage, there are some resize scenarios where the percentage value may not be 100% stable/deterministic, as the size of the padding is used to compute the number of rows/columns.</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"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L36" href="#L36">36</a><span class="code-text"><a-p>You may use a fractional number such as `&quot;0.5cell&quot;` or numbers larger than one such as `&quot;72pt&quot;`.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L37" href="#L37">37</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L38" href="#L38">38</a><span class="code-text"><a-p>The default padding is shown below.  In earlier releases, the default padding was 0 for each of the possible edges.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L39" href="#L39">39</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L40" href="#L40">40</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="L41" href="#L41">41</a><span class="code-text"><a-p>config.</a-p><a-v>window_padding</a-v><a-p> = </a-p><a-cr>{</a-cr></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L42" href="#L42">42</a><span class="code-text"><a-p>  </a-p><a-v>left</a-v><a-p> = </a-p><a-s>&#39;1cell&#39;</a-s><a-p>,</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L43" href="#L43">43</a><span class="code-text"><a-p>  </a-p><a-v>right</a-v><a-p> = </a-p><a-s>&#39;1cell&#39;</a-s><a-p>,</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L44" href="#L44">44</a><span class="code-text"><a-p>  </a-p><a-v>top</a-v><a-p> = </a-p><a-s>&#39;0.5cell&#39;</a-s><a-p>,</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L45" href="#L45">45</a><span class="code-text"><a-p>  </a-p><a-v>bottom</a-v><a-p> = </a-p><a-s>&#39;0.5cell&#39;</a-s><a-p>,</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L46" href="#L46">46</a><span class="code-text"><a-p>}</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L47" href="#L47">47</a><span class="code-text"><a-p>```</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L48" href="#L48">48</a><span class="code-text"></span></span></pre></div></div>
</main>
</body>
</html>
