<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>docs/scrollback.md - fork/wezterm @ termwiz-0.23.2</title>
<meta name="description" content="docs/scrollback.md in fork/wezterm at termwiz-0.23.2.">
<meta property="og:title" content="docs/scrollback.md - fork/wezterm @ termwiz-0.23.2">
<meta property="og:description" content="docs/scrollback.md 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">Wez Furlong</span><span class="commit-message" data-commit="40081cb5737da32058a3c87e14b84d8f2bfefdc4">docs: update a bunch of since lines to new macro</span><span class="snapshot-sha sha" data-commit="40081cb5737da32058a3c87e14b84d8f2bfefdc4">40081cb57</span><time datetime="2023-03-20T22:01:24-07:00" title="2023-03-20 22:01:24 -0700">2023-03-20</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> / <span class="cur">scrollback.md</span></nav>
<span class="view-stats"><span>5.2 KiB</span><span>138 lines</span></span><span class="actions"><a class="raw" href="/fork/wezterm/raw/f3788736425c05cf770df6ffdb43b284b204d3c0/docs/scrollback.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"><p>WezTerm provides a searchable scrollback buffer with a configurable maximum
size limit that allows you to review information that doesn't fit in the
physical window size.  As content is printed to the display the display may be
scrolled up to accommodate newly added lines.  The scrolled lines are moved
into the scrollback buffer and can be reviewed by scrolling the window up or
down.</p>
<p>This section describes working with the scrollback and discusses some
configuration options; be sure to read the <a href="/fork/wezterm/ref/termwiz-0.23.2/blob/docs/config/files.md">configuration
docs</a> to learn how to change your settings!</p>
<h3>Controlling the scrollback size</h3>
<p>This value serves as an upper bound on the number of lines.
The larger this value, the more memory is required to manage the tab.
If you have a lot of long lived tabs then making this value very large
may put some pressure on your system depending on the amount of RAM
you have available.</p>
<pre class="language-lua"><a-c>-- How many lines of scrollback you want to retain per tab</a-c>
<a-v>config</a-v><a-p>.</a-p><a-v>scrollback_lines</a-v> = <a-n>3500</a-n></pre>
<h3>Clearing the scrollback buffer</h3>
<p>By default, <code>CTRL-SHIFT-K</code> and <code>CMD-K</code> will trigger the <code>ClearScrollback</code>
action and discard the contents of the scrollback buffer.  There is no way
to undo discarding the scrollback.</p>
<p>See the <a href="/fork/wezterm/ref/termwiz-0.23.2/blob/docs/config/lua/keyassignment/ClearScrollback.md">ClearScrollback</a> docs for information
on rebinding this key.</p>
<h3>Enable/Disable scrollbar</h3>
<p>You can control whether WezTerm displays a scrollbar via your configuration
file:</p>
<pre class="language-lua"><a-c>-- Enable the scrollbar.</a-c>
<a-c>-- It will occupy the right window padding space.</a-c>
<a-c>-- If right padding is set to 0 then it will be increased</a-c>
<a-c>-- to a single cell width</a-c>
<a-v>config</a-v><a-p>.</a-p><a-v>enable_scroll_bar</a-v> = <a-co>true</a-co></pre>
<p>You may <a href="/fork/wezterm/ref/termwiz-0.23.2/blob/docs/config/appearance.md#defining-your-own-colors">change the color of the scrollbar</a> if you wish!</p>
<h3>Scrolling without a scrollbar</h3>
<p>By default, <code>SHIFT-PageUp</code> and <code>SHIFT-PageDown</code> will adjust the viewport scrollback position
by one full screen for each press.</p>
<p>See the <a href="/fork/wezterm/ref/termwiz-0.23.2/blob/docs/config/lua/keyassignment/ScrollByPage.md">ScrollByPage</a> docs for more information
on this key binding assignment.</p>
<h3>Searching the scrollback</h3>
<p>By default, <code>CTRL-SHIFT-F</code> and <code>CMD-F</code> (<code>F</code> for <code>Find</code>) will activate the
search overlay in the current tab.</p>
<p>When the search overlay is active the behavior of wezterm changes:</p>
<ul>
<li>Typing (or pasting) text will populate the <em>search pattern</em> in the bar at the bottom of the screen.</li>
<li>Text from the scrollback that matches the <em>search pattern</em> will be highlighted and
the number of matches shown in the search bar.</li>
<li>The bottom-most match will be selected and the viewport scrolled to show the selected
text.</li>
<li><code>Enter</code>, <code>UpArrow</code> and <code>CTRL-P</code> will cause the selection to move to any prior matching text.</li>
<li><code>PageUp</code> will traverse to previous matches one page at a time.</li>
<li><code>CTRL-N</code> and <code>DownArrow</code> will cause the selection to move to any next matching text.</li>
<li><code>PageDown</code> will traverse to the next match one page at a time.</li>
<li><code>CTRL-R</code> will cycle through the pattern matching mode; the initial mode is case-sensitive
text matching, the next will match ignoring case and the last will match using the
<a href="https://docs.rs/regex/1.3.9/regex/#syntax">regular expression syntax described here</a>.
The matching mode is indicated in the search bar.</li>
<li><code>CTRL-U</code> will clear the <em>search pattern</em> so you can start over.</li>
<li><code>CTRL-SHIFT-C</code> will copy the selected text to the clipboard.</li>
<li><code>Escape</code> will cancel the search overlay, leaving the currently selected text selected
with the viewport scrolled to that location.</li>
</ul>
<h4>Configurable search mode key assignments</h4>
<p>{{since('20220624-141144-bd1b7c5d')}}</p>
<p>The key assignments for search mode are specified by the <code>search_mode</code> <a href="/fork/wezterm/ref/termwiz-0.23.2/blob/docs/config/key-tables.md">Key Table</a>.</p>
<p>You may use
<a href="/fork/wezterm/ref/termwiz-0.23.2/blob/docs/config/lua/wezterm.gui/default_key_tables.md">wezterm.gui.default_key_tables</a>
to obtain the defaults and extend them. In earlier versions of wezterm there
wasn't a way to override portions of the key table, only to replace the entire
table.</p>
<p>The default configuration at the time that these docs were built (which
may be more recent than your version of wezterm) is shown below.</p>
<p>You can see the configuration in your version of wezterm by running
<code>wezterm show-keys --lua --key-table search_mode</code>.</p>
<p>{% include "examples/default-search-mode-key-table.markdown" %}</p>
<p>(Those assignments reference <code>CopyMode</code> because search mode is a facet of <a href="/fork/wezterm/ref/termwiz-0.23.2/blob/docs/copymode.md">Copy Mode</a>).</p>
<h3>Configuring Saved Searches</h3>
<p>{{since('20200607-144723-74889cd4')}}</p>
<p>If you find that you're often searching for the same things then you may wish to assign
a keybinding to trigger that search.</p>
<p>For example, if you find that you're frequently running <code>git log</code> and then reaching
for your mouse to copy and paste a relevant git commit hash then you might like
this:</p>
<pre class="language-lua"><a-v>config</a-v><a-p>.</a-p><a-v>keys</a-v> = <a-cr>{</a-cr>
  <a-c>-- search for things that look like git hashes</a-c>
  <a-cr>{</a-cr>
    <a-v>key</a-v> = <a-s>&#39;H&#39;</a-s><a-p>,</a-p>
    <a-v>mods</a-v> = <a-s>&#39;SHIFT|CTRL&#39;</a-s><a-p>,</a-p>
    <a-v>action</a-v> = <a-v>wezterm</a-v><a-p>.</a-p><a-v>action</a-v><a-p>.</a-p><a-f>Search</a-f> <a-cr>{</a-cr> <a-v>Regex</a-v> = <a-s>&#39;[a-f0-9]{6,}&#39;</a-s> <a-cr>}</a-cr><a-p>,</a-p>
  <a-cr>}</a-cr><a-p>,</a-p>
<a-cr>}</a-cr></pre>
<p>With that in your config you can now:</p>
<ul>
<li><code>CTRL-SHIFT-H</code> to highlight all the git hashes and select the closest one to the bottom
of the screen.</li>
<li>Use <code>ENTER</code>/<code>CTRL-N</code>/<code>CTRL-P</code> to cycle through the git hashes</li>
<li><code>CTRL-SHIFT-C</code> to copy</li>
<li><code>Escape</code></li>
<li><code>CTRL-SHIFT-V</code> (or <code>SHIFT-Insert</code>) to Paste</li>
</ul>
<p>without needing to reach for your mouse.</p>
<p>See <a href="/fork/wezterm/ref/termwiz-0.23.2/blob/docs/config/lua/keyassignment/Search.md">the Search action docs</a> for more information on
using the <code>Search</code> action.</p>
</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">WezTerm provides a searchable scrollback buffer with a configurable maximum</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L2" href="#L2">2</a><span class="code-text">size limit that allows you to review information that doesn&#39;t fit in the</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L3" href="#L3">3</a><span class="code-text">physical window size.  As content is printed to the display the display may be</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L4" href="#L4">4</a><span class="code-text">scrolled up to accommodate newly added lines.  The scrolled lines are moved</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L5" href="#L5">5</a><span class="code-text">into the scrollback buffer and can be reviewed by scrolling the window up or</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L6" href="#L6">6</a><span class="code-text">down.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L7" href="#L7">7</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L8" href="#L8">8</a><span class="code-text">This section describes working with the scrollback and discusses some</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L9" href="#L9">9</a><span class="code-text">configuration options; be sure to read the [configuration</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L10" href="#L10">10</a><span class="code-text">docs](config/files.md) to learn how to change your settings!</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"><a-p>###</a-p> <a-tt>Controlling the scrollback size</a-tt></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">This value serves as an upper bound on the number of lines.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L15" href="#L15">15</a><span class="code-text">The larger this value, the more memory is required to manage the tab.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L16" href="#L16">16</a><span class="code-text">If you have a lot of long lived tabs then making this value very large</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L17" href="#L17">17</a><span class="code-text">may put some pressure on your system depending on the amount of RAM</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L18" href="#L18">18</a><span class="code-text">you have available.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L19" href="#L19">19</a><span class="code-text"></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-tl>lua</a-tl></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>-- How many lines of scrollback you want to retain per tab</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>config.</a-p><a-v>scrollback_lines</a-v><a-p> = </a-p><a-n>3500</a-n></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"></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><a-tt>Clearing the scrollback buffer</a-tt></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>By default, `CTRL-SHIFT-K` and `CMD-K` will trigger the `ClearScrollback`</a-p></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>action and discard the contents of the scrollback buffer.  There is no way</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>to undo discarding the scrollback.</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>See the [ClearScrollback](config/lua/keyassignment/ClearScrollback.md) docs for information</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>on rebinding this key.</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>### </a-p><a-tt>Enable/Disable scrollbar</a-tt></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 can control whether WezTerm displays a scrollbar via your configuration</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"><a-p>file:</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L38" href="#L38">38</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L39" href="#L39">39</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="L40" href="#L40">40</a><span class="code-text"><a-p>-- Enable the scrollbar.</a-p></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>-- It will occupy the right window padding space.</a-p></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>-- If right padding is set to 0 then it will be increased</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>-- to a single cell width</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>config.</a-p><a-v>enable_scroll_bar</a-v><a-p> = </a-p><a-co>true</a-co></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></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L46" href="#L46">46</a><span class="code-text"></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>You may [change the color of the scrollbar](config/appearance.md#defining-your-own-colors) if you wish!</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 class="code-break">
</span></span><span class="code-line"><a class="ln" id="L49" href="#L49">49</a><span class="code-text"><a-p>### </a-p><a-tt>Scrolling without a scrollbar</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L50" href="#L50">50</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L51" href="#L51">51</a><span class="code-text"><a-p>By default, `SHIFT-PageUp` and `SHIFT-PageDown` will adjust the viewport scrollback position</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L52" href="#L52">52</a><span class="code-text"><a-p>by one full screen for each press.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L53" href="#L53">53</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L54" href="#L54">54</a><span class="code-text"><a-p>See the [ScrollByPage](config/lua/keyassignment/ScrollByPage.md) docs for more information</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L55" href="#L55">55</a><span class="code-text"><a-p>on this key binding assignment.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L56" href="#L56">56</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L57" href="#L57">57</a><span class="code-text"><a-p>### </a-p><a-tt>Searching the scrollback</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L58" href="#L58">58</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L59" href="#L59">59</a><span class="code-text"><a-p>By default, `CTRL-SHIFT-F` and `CMD-F` (`F` for `Find`) will activate the</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L60" href="#L60">60</a><span class="code-text"><a-p>search overlay in the current tab.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L61" href="#L61">61</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L62" href="#L62">62</a><span class="code-text"><a-p>When the search overlay is active the behavior of wezterm changes:</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L63" href="#L63">63</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L64" href="#L64">64</a><span class="code-text"><a-p>* Typing (or pasting) text will populate the *search pattern* in the bar at the bottom of the screen.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L65" href="#L65">65</a><span class="code-text"><a-p>* Text from the scrollback that matches the *search pattern* will be highlighted and</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L66" href="#L66">66</a><span class="code-text"><a-p>  the number of matches shown in the search bar.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L67" href="#L67">67</a><span class="code-text"><a-p>* The bottom-most match will be selected and the viewport scrolled to show the selected</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L68" href="#L68">68</a><span class="code-text"><a-p>  text.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L69" href="#L69">69</a><span class="code-text"><a-p>* `Enter`, `UpArrow` and `CTRL-P` will cause the selection to move to any prior matching text.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L70" href="#L70">70</a><span class="code-text"><a-p>* `PageUp` will traverse to previous matches one page at a time.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L71" href="#L71">71</a><span class="code-text"><a-p>* `CTRL-N` and `DownArrow` will cause the selection to move to any next matching text.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L72" href="#L72">72</a><span class="code-text"><a-p>* `PageDown` will traverse to the next match one page at a time.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L73" href="#L73">73</a><span class="code-text"><a-p>* `CTRL-R` will cycle through the pattern matching mode; the initial mode is case-sensitive</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L74" href="#L74">74</a><span class="code-text"><a-p>  text matching, the next will match ignoring case and the last will match using the</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L75" href="#L75">75</a><span class="code-text"><a-p>  [regular expression syntax described here](https://docs.rs/regex/1.3.9/regex/#syntax).</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L76" href="#L76">76</a><span class="code-text"><a-p>  The matching mode is indicated in the search bar.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L77" href="#L77">77</a><span class="code-text"><a-p>* `CTRL-U` will clear the *search pattern* so you can start over.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L78" href="#L78">78</a><span class="code-text"><a-p>* `CTRL-SHIFT-C` will copy the selected text to the clipboard.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L79" href="#L79">79</a><span class="code-text"><a-p>* `Escape` will cancel the search overlay, leaving the currently selected text selected</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L80" href="#L80">80</a><span class="code-text"><a-p>  with the viewport scrolled to that location.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L81" href="#L81">81</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L82" href="#L82">82</a><span class="code-text"><a-p>#### </a-p><a-tt>Configurable search mode key assignments</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L83" href="#L83">83</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L84" href="#L84">84</a><span class="code-text"><a-p>{{since(&#39;20220624-141144-bd1b7c5d&#39;)}}</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L85" href="#L85">85</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L86" href="#L86">86</a><span class="code-text"><a-p>The key assignments for search mode are specified by the `search_mode` [Key Table](config/key-tables.md).</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L87" href="#L87">87</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L88" href="#L88">88</a><span class="code-text"><a-p>You may use</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L89" href="#L89">89</a><span class="code-text"><a-p>[wezterm.gui.default_key_tables](config/lua/wezterm.gui/default_key_tables.md)</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L90" href="#L90">90</a><span class="code-text"><a-p>to obtain the defaults and extend them. In earlier versions of wezterm there</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L91" href="#L91">91</a><span class="code-text"><a-p>wasn&#39;t a way to override portions of the key table, only to replace the entire</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L92" href="#L92">92</a><span class="code-text"><a-p>table.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L93" href="#L93">93</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L94" href="#L94">94</a><span class="code-text"><a-p>The default configuration at the time that these docs were built (which</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L95" href="#L95">95</a><span class="code-text"><a-p>may be more recent than your version of wezterm) is shown below.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L96" href="#L96">96</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L97" href="#L97">97</a><span class="code-text"><a-p>You can see the configuration in your version of wezterm by running</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L98" href="#L98">98</a><span class="code-text"><a-p>`wezterm show-keys --lua --key-table search_mode`.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L99" href="#L99">99</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L100" href="#L100">100</a><span class="code-text"><a-p>{% include &quot;examples/default-search-mode-key-table.markdown&quot; %}</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L101" href="#L101">101</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L102" href="#L102">102</a><span class="code-text"><a-p>(Those assignments reference `CopyMode` because search mode is a facet of [Copy Mode](copymode.md)).</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L103" href="#L103">103</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L104" href="#L104">104</a><span class="code-text"><a-p>### </a-p><a-tt>Configuring Saved Searches</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L105" href="#L105">105</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L106" href="#L106">106</a><span class="code-text"><a-p>{{since(&#39;20200607-144723-74889cd4&#39;)}}</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L107" href="#L107">107</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L108" href="#L108">108</a><span class="code-text"><a-p>If you find that you&#39;re often searching for the same things then you may wish to assign</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L109" href="#L109">109</a><span class="code-text"><a-p>a keybinding to trigger that search.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L110" href="#L110">110</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L111" href="#L111">111</a><span class="code-text"><a-p>For example, if you find that you&#39;re frequently running `git log` and then reaching</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L112" href="#L112">112</a><span class="code-text"><a-p>for your mouse to copy and paste a relevant git commit hash then you might like</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L113" href="#L113">113</a><span class="code-text"><a-p>this:</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L114" href="#L114">114</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L115" href="#L115">115</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="L116" href="#L116">116</a><span class="code-text"><a-p>config.</a-p><a-v>keys</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="L117" href="#L117">117</a><span class="code-text"><a-p>  </a-p><a-c>-- search for things that look like git hashes</a-c></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L118" href="#L118">118</a><span class="code-text"><a-p>  </a-p><a-cr>{</a-cr></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L119" href="#L119">119</a><span class="code-text"><a-p>    </a-p><a-v>key</a-v><a-p> = </a-p><a-s>&#39;H&#39;</a-s><a-p>,</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L120" href="#L120">120</a><span class="code-text"><a-p>    </a-p><a-v>mods</a-v><a-p> = </a-p><a-s>&#39;SHIFT|CTRL&#39;</a-s><a-p>,</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L121" href="#L121">121</a><span class="code-text"><a-p>    </a-p><a-v>action</a-v><a-p> = </a-p><a-v>wezterm</a-v><a-p>.</a-p><a-v>action</a-v><a-p>.</a-p><a-f>Search</a-f><a-p> </a-p><a-cr>{</a-cr><a-p> </a-p><a-v>Regex</a-v><a-p> = </a-p><a-s>&#39;[a-f0-9]{6,}&#39;</a-s><a-p> </a-p><a-cr>}</a-cr><a-p>,</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L122" href="#L122">122</a><span class="code-text"><a-p>  </a-p><a-cr>}</a-cr><a-p>,</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L123" href="#L123">123</a><span class="code-text"><a-p>}</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L124" href="#L124">124</a><span class="code-text"><a-p>```</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L125" href="#L125">125</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L126" href="#L126">126</a><span class="code-text"><a-p>With that in your config you can now:</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L127" href="#L127">127</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L128" href="#L128">128</a><span class="code-text"><a-p>* `CTRL-SHIFT-H` to highlight all the git hashes and select the closest one to the bottom</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L129" href="#L129">129</a><span class="code-text"><a-p>  of the screen.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L130" href="#L130">130</a><span class="code-text"><a-p>* Use `ENTER`/`CTRL-N`/`CTRL-P` to cycle through the git hashes</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L131" href="#L131">131</a><span class="code-text"><a-p>* `CTRL-SHIFT-C` to copy</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L132" href="#L132">132</a><span class="code-text"><a-p>* `Escape`</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L133" href="#L133">133</a><span class="code-text"><a-p>* `CTRL-SHIFT-V` (or `SHIFT-Insert`) to Paste</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L134" href="#L134">134</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L135" href="#L135">135</a><span class="code-text">without needing to reach for your mouse.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L136" href="#L136">136</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L137" href="#L137">137</a><span class="code-text">See [the Search action docs](config/lua/keyassignment/Search.md) for more information on</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L138" href="#L138">138</a><span class="code-text">using the `Search` action.</span></span></pre></div></div>
</main>
</body>
</html>
