<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>CONTRIBUTING.md - fork/wezterm @ termwiz-0.23.0</title>
<meta name="description" content="CONTRIBUTING.md in fork/wezterm at termwiz-0.23.0.">
<meta property="og:title" content="CONTRIBUTING.md - fork/wezterm @ termwiz-0.23.0">
<meta property="og:description" content="CONTRIBUTING.md in fork/wezterm at termwiz-0.23.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="termwiz-0.23.0" data-tip="958804c8ac16b750954b3bcaaf847e7498cd2205">
<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="11c4b11669d9ce23d51afaf286b5383fbdc9794f">s,wez/wezterm,wezterm/wezterm,</span><span class="snapshot-sha sha" data-commit="11c4b11669d9ce23d51afaf286b5383fbdc9794f">11c4b1166</span><time datetime="2025-02-07T13:08:01-07:00" title="2025-02-07 13:08:01 -0700">2025-02-07</time></p>
<header class="topbar"><details class="switcher"><summary>termwiz-0.23.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 class="current" 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 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> / <span class="cur">CONTRIBUTING.md</span></nav>
<span class="view-stats"><span>4.5 KiB</span><span>131 lines</span></span><span class="actions"><a class="raw" href="/fork/wezterm/raw/a06f28f2db06ac012c6865b8646a2c803f0576a0/CONTRIBUTING.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>Contributing to wezterm</h1>
<p>Thanks for considering donating your time and energy!  I value any contribution,
even if it is just to highlight a typo.</p>
<p>Included here are some guidelines that can help streamline taking in your contribution.
They are just guidelines and not hard-and-fast rules.  Things will probably go faster
and smoother if you have the time and energy to read and follow these suggestions.</p>
<h2>Contributing Documentation</h2>
<p>There's never enough!  Pretty much anything is fair game to improve here.</p>
<h3>Running the doc build yourself</h3>
<p>To check your documentation additions, you can optionally build the docs yourself and see how the changes will look on the webpage.</p>
<p>To serve them up, and then automatically rebuild and refresh the docs in your browser, run:</p>
<pre class="language-bash"><a-o>$</a-o><a-f> </a-f><a-pr>ci</a-pr><a-f>/build-docs.sh</a-f> serve</pre>
<p>And then click on the URL that it prints out after it has performed the first build.</p>
<p>Any arguments passed to <code>build-docs.sh</code> are passed down to the underlying <code>mkdocs</code> utility.</p>
<p>Look at <a href="https://www.mkdocs.org/user-guide/cli/#mkdocs-serve">mkdocs serve</a> for more information on additional parameters.</p>
<h3>Operating system specific installation instructions?</h3>
<p>There are a lot of targets out there.  Today we have docs that are Ubuntu biased
and I know that there are a lot of flavors of Linux.  Rather than expand the README
with instructions for those, please translate the instructions into steps that
can be run in the <a href="https://github.com/wezterm/wezterm/blob/master/get-deps"><code>get-deps</code></a>
script.</p>
<h2>Contributing code</h2>
<p>Yes please!</p>
<p>If you are new to the Rust language check out <a href="https://doc.rust-lang.org/rust-by-example/">https://doc.rust-lang.org/rust-by-example/</a>.</p>
<h3>Where to find things?</h3>
<p>The <code>term</code> directory holds the core terminal model code.  This is agnostic
of any windowing system.  If you want to add support for terminal escape
sequences and that sort of thing, you probably want to be in the <code>term</code> dir.
Keep in mind that for maximal compatibility and utility <code>wezterm</code> aims to
be compatible with the <code>xterm</code> behavior.
https://invisible-island.net/xterm/ctlseqs/ctlseqs.html is a useful resource!</p>
<p>The <code>src</code> directory holds the code for the <code>wezterm</code> program.  This is
the GUI renderer for the terminal model.  If you want to change something
about the GUI you want to be in the <code>src</code> dir.</p>
<h3>Iterating</h3>
<p>I tend to iterate and sanity check as I develop using <code>cargo check</code>; it
will type-check your code without generating code which is much faster
than building everything in release mode:</p>
<pre class="language-bash"><a-o>$</a-o><a-f> </a-f><a-pr>cargo</a-pr> check</pre>
<p>Likewise, if you want to quick check that something works, you can run it
in debug mode using:</p>
<pre class="language-bash"><a-o>$</a-o><a-f> </a-f><a-pr>cargo</a-pr> run</pre>
<p>This will produce a debug instrumented binary with poor optimization.  This will
give you more detail in the backtrace produced if you run <code>RUST_BACKTRACE=1 cargo run</code>.</p>
<p>If you get a panic and want to examine local variables, you'll need to use gdb:</p>
<pre class="language-bash"><a-o>$</a-o><a-f> </a-f><a-pr>cargo</a-pr> build
<a-o>$</a-o><a-f> </a-f><a-pr>gdb</a-pr> ./target/debug/wezterm
<a-o>$</a-o><a-f> </a-f><a-pr>break</a-pr> rust_panic               <a-c># hit tab to complete the name of the panic symbol!</a-c>
<a-o>$</a-o><a-f> </a-f><a-pr>run</a-pr>
<a-o>$</a-o><a-f> </a-f><a-pr>bt</a-pr></pre>
<h3>Please include tests to cover your changes!</h3>
<p>This will help ensure that your contributions keep working as things change.</p>
<p>You can run the existing tests using:</p>
<pre class="language-bash"><a-o>$</a-o><a-f> </a-f><a-pr>cargo</a-pr> test <a-co>--all</a-co></pre>
<p>There are some helper classes for writing tests for terminal behavior.
Here's an example of a test to verify that the terminal contents
match expectations:</p>
<p>https://github.com/wezterm/wezterm/blob/master/term/src/test/mod.rs#L334</p>
<p>Please also make a point of adding comments to your tests to help
clarify the intent of the test!</p>
<h3>Please also include documentation if you are adding or changing behavior</h3>
<p>This helps to keep things well-understood and working in the long term.
Don't worry if you're not a wordsmith or English isn't your first language as
I can help with that.  It is more important to capture the intent of the
feature and having this written out in English also helps when it comes
to reviewing the code.</p>
<h2>Submitting a Pull Request</h2>
<p>After considering all of the above, and once you're prepared your contribution
and are ready to submit it, you'll need to create a pull request.</p>
<p>If you're new to GitHub pull requests, read through
https://help.github.com/articles/creating-a-pull-request/ to understand
how that process works.</p>
<h3>Before your submit your code</h3>
<p>Make sure that the tests are working and that the code is correctly
formatted otherwise the continuous integration system will fail your build:</p>
<pre class="language-bash"><a-o>$</a-o><a-f> </a-f><a-pr>rustup</a-pr> component add rustfmt-preview          <a-c># you only need to do this once</a-c>
<a-o>$</a-o><a-f> </a-f><a-pr>cargo</a-pr> test <a-co>--all</a-co>
<a-o>$</a-o><a-f> </a-f><a-pr>cargo</a-pr> fmt <a-co>--all</a-co></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> <a-tt>Contributing to wezterm</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">Thanks for considering donating your time and energy!  I value any contribution,</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L4" href="#L4">4</a><span class="code-text">even if it is just to highlight a typo.</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">Included here are some guidelines that can help streamline taking in your contribution.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L7" href="#L7">7</a><span class="code-text">They are just guidelines and not hard-and-fast rules.  Things will probably go faster</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 smoother if you have the time and energy to read and follow these suggestions.</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"><a-p>##</a-p> <a-tt>Contributing Documentation</a-tt></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">There&#39;s never enough!  Pretty much anything is fair game to improve here.</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"><a-p>###</a-p> <a-tt>Running the doc build yourself</a-tt></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">To check your documentation additions, you can optionally build the docs yourself and see how the changes will look on the webpage. </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">To serve them up, and then automatically rebuild and refresh the docs in your browser, run:</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-tl>console</a-tl></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>$ ci/build-docs.sh serve</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></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>And then click on the URL that it prints out after it has performed the first build.</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"></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>Any arguments passed to `build-docs.sh` are passed down to the underlying `mkdocs` utility.</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>Look at [mkdocs serve](https://www.mkdocs.org/user-guide/cli/#mkdocs-serve) for more information on additional parameters.</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>### </a-p><a-tt>Operating system specific installation instructions?</a-tt></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 class="code-break">
</span></span><span class="code-line"><a class="ln" id="L30" href="#L30">30</a><span class="code-text"><a-p>There are a lot of targets out there.  Today we have docs that are Ubuntu biased</a-p></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>and I know that there are a lot of flavors of Linux.  Rather than expand the README</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>with instructions for those, please translate the instructions into steps that</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>can be run in the [`get-deps`](https://github.com/wezterm/wezterm/blob/master/get-deps)</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>script.</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>## </a-p><a-tt>Contributing code</a-tt></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>Yes please!</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>If you are new to the Rust language check out &lt;https://doc.rust-lang.org/rust-by-example/&gt;.</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"></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-tt>Where to find things?</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L43" href="#L43">43</a><span class="code-text"></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>The `term` directory holds the core terminal model code.  This is agnostic</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>of any windowing system.  If you want to add support for terminal escape</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>sequences and that sort of thing, you probably want to be in the `term` dir.</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>Keep in mind that for maximal compatibility and utility `wezterm` aims to</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"><a-p>be compatible with the `xterm` behavior.</a-p></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>https://invisible-island.net/xterm/ctlseqs/ctlseqs.html is a useful resource!</a-p></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>The `src` directory holds the code for the `wezterm` program.  This is</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>the GUI renderer for the terminal model.  If you want to change something</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"><a-p>about the GUI you want to be in the `src` dir.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L54" href="#L54">54</a><span class="code-text"></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>### </a-p><a-tt>Iterating</a-tt></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>I tend to iterate and sanity check as I develop using `cargo check`; it</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L58" href="#L58">58</a><span class="code-text"><a-p>will type-check your code without generating code which is much faster</a-p></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>than building everything in release mode:</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"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L61" href="#L61">61</a><span class="code-text"><a-p>```</a-p><a-tl>console</a-tl></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>$ cargo check</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"><a-p>```</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L64" href="#L64">64</a><span class="code-text"></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>Likewise, if you want to quick check that something works, you can run it</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>in debug mode using:</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"></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>```</a-p><a-tl>console</a-tl></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>$ cargo run</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>```</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"></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>This will produce a debug instrumented binary with poor optimization.  This will</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>give you more detail in the backtrace produced if you run `RUST_BACKTRACE=1 cargo run`.</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"></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>If you get a panic and want to examine local variables, you&#39;ll need to use gdb:</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"></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>```</a-p><a-tl>console</a-tl></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>$ cargo build</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>$ gdb ./target/debug/wezterm</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>$ break rust_panic               # hit tab to complete the name of the panic symbol!</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"><a-p>$ run</a-p></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>$ bt</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L83" href="#L83">83</a><span class="code-text"><a-p>```</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L84" href="#L84">84</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L85" href="#L85">85</a><span class="code-text"><a-p>### </a-p><a-tt>Please include tests to cover your changes!</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L86" href="#L86">86</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L87" href="#L87">87</a><span class="code-text"><a-p>This will help ensure that your contributions keep working as things change.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L88" href="#L88">88</a><span class="code-text"></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>You can run the existing tests using:</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"></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>```</a-p><a-tl>console</a-tl></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>$ cargo test --all</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"><a-p>```</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L94" href="#L94">94</a><span class="code-text"></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>There are some helper classes for writing tests for terminal behavior.</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"><a-p>Here&#39;s an example of a test to verify that the terminal contents</a-p></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>match expectations:</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"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L99" href="#L99">99</a><span class="code-text"><a-p>https://github.com/wezterm/wezterm/blob/master/term/src/test/mod.rs#L334</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L100" href="#L100">100</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L101" href="#L101">101</a><span class="code-text"><a-p>Please also make a point of adding comments to your tests to help</a-p></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>clarify the intent of the test!</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>Please also include documentation if you are adding or changing behavior</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>This helps to keep things well-understood and working in the long term.</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"><a-p>Don&#39;t worry if you&#39;re not a wordsmith or English isn&#39;t your first language as</a-p></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>I can help with that.  It is more important to capture the intent of the</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>feature and having this written out in English also helps when it comes</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"><a-p>to reviewing the code.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L111" href="#L111">111</a><span class="code-text"></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>## </a-p><a-tt>Submitting a Pull Request</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L113" href="#L113">113</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L114" href="#L114">114</a><span class="code-text"><a-p>After considering all of the above, and once you&#39;re prepared your contribution</a-p></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>and are ready to submit it, you&#39;ll need to create a pull request.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L116" href="#L116">116</a><span class="code-text"></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>If you&#39;re new to GitHub pull requests, read through</a-p></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>https://help.github.com/articles/creating-a-pull-request/ to understand</a-p></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>how that process works.</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"></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-tt>Before your submit your code</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L122" href="#L122">122</a><span class="code-text"></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>Make sure that the tests are working and that the code is correctly</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>formatted otherwise the continuous integration system will fail your build:</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>```</a-p><a-tl>console</a-tl></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L127" href="#L127">127</a><span class="code-text"><a-p>$ rustup component add rustfmt-preview          # you only need to do this once</a-p></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>$ cargo test --all</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>$ cargo fmt --all</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>```</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"></span></span></pre></div></div>
</main>
</body>
</html>
