<p dir="auto">Initial window height is off by titlebar height. This got regressed by <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="515647698" data-permission-text="Title is private" data-url="https://github.com/microsoft/terminal/issues/3394" data-hovercard-type="pull_request" data-hovercard-url="/microsoft/terminal/pull/3394/hovercard" href="https://github.com/microsoft/terminal/pull/3394">#3394</a> in:</p>
<p dir="auto"></p><div class="Box Box--condensed my-2">
  <div class="Box-header f6">
    <p class="mb-0 text-bold">
      <a href="https://github.com/microsoft/terminal/blob/357e835f5d37492812e33eac1dd995232c19de63/src/cascadia/WindowsTerminal/AppHost.cpp#L197-L210">terminal/src/cascadia/WindowsTerminal/AppHost.cpp</a>
    </p>
    <p class="mb-0 color-fg-muted">
        Lines 197 to 210
      in
      <a data-pjax="true" class="commit-tease-sha" href="/microsoft/terminal/commit/357e835f5d37492812e33eac1dd995232c19de63">357e835</a>
    </p>
  </div>
  <div itemprop="text" class="Box-body p-0 blob-wrapper blob-wrapper-embedded data">
    <table class="highlight tab-size mb-0 js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">

        <tbody><tr class="border-0">
          <td id="L197" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="197"></td>
          <td id="LC197" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> RECT islandFrame = {}; </td>
        </tr>

        <tr class="border-0">
          <td id="L198" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="198"></td>
          <td id="LC198" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">bool</span> succeeded = <span class="pl-c1">AdjustWindowRectExForDpi</span>(&amp;islandFrame, WS_OVERLAPPEDWINDOW, <span class="pl-c1">false</span>, <span class="pl-c1">0</span>, dpix); </td>
        </tr>

        <tr class="border-0">
          <td id="L199" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="199"></td>
          <td id="LC199" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">//</span> If we failed to get the correct window size for whatever reason, log</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L200" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="200"></td>
          <td id="LC200" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">//</span> the error and go on. We'll use whatever the control proposed as the</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L201" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="201"></td>
          <td id="LC201" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-c"><span class="pl-c">//</span> size of our window, which will be at least close.</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L202" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="202"></td>
          <td id="LC202" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-c1">LOG_LAST_ERROR_IF</span>(!succeeded); </td>
        </tr>

        <tr class="border-0">
          <td id="L203" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="203"></td>
          <td id="LC203" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">  </td>
        </tr>

        <tr class="border-0">
          <td id="L204" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="204"></td>
          <td id="LC204" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">if</span> (_useNonClientArea) </td>
        </tr>

        <tr class="border-0">
          <td id="L205" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="205"></td>
          <td id="LC205" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> { </td>
        </tr>

        <tr class="border-0">
          <td id="L206" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="206"></td>
          <td id="LC206" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">     islandFrame.<span class="pl-smi">top</span> = -NonClientIslandWindow::topBorderVisibleHeight; </td>
        </tr>

        <tr class="border-0">
          <td id="L207" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="207"></td>
          <td id="LC207" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> } </td>
        </tr>

        <tr class="border-0">
          <td id="L208" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="208"></td>
          <td id="LC208" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">  </td>
        </tr>

        <tr class="border-0">
          <td id="L209" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="209"></td>
          <td id="LC209" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> adjustedWidth = -islandFrame.<span class="pl-smi">left</span> + islandWidth + islandFrame.<span class="pl-smi">right</span>; </td>
        </tr>

        <tr class="border-0">
          <td id="L210" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="210"></td>
          <td id="LC210" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> adjustedHeight = -islandFrame.<span class="pl-smi">top</span> + islandHeight + islandFrame.<span class="pl-smi">bottom</span>; </td>
        </tr>
    </tbody></table>
  </div>
</div>
<p></p>
<p dir="auto">That also blocks <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="506354568" data-permission-text="Title is private" data-url="https://github.com/microsoft/terminal/issues/3181" data-hovercard-type="pull_request" data-hovercard-url="/microsoft/terminal/pull/3181/hovercard" href="https://github.com/microsoft/terminal/pull/3181">#3181</a> which relys on this size calculation.</p>
<h1 dir="auto">Steps to reproduce</h1>
<ol dir="auto">
<li>Set <code class="notranslate">fontSize</code> to 50</li>
<li>Set <code class="notranslate">initialRows</code> to 2</li>
<li>Launch terminal</li>
</ol>
<h1 dir="auto">Expected behavior</h1>
<p dir="auto">2 rows should fit in the window</p>
<h1 dir="auto">Actual behavior</h1>
<p dir="auto">About 1.5 of a row fits.</p>
<p dir="auto">cc @greg904.</p>
<h1 dir="auto">Environment</h1>
<p dir="auto">Windows build number: 10.0.18362.239<br>
Windows Terminal version (if applicable): 0.3.2171.0</p>
<h1 dir="auto">Steps to reproduce</h1>
<ul dir="auto">
<li>Open Windows Terminal (Preview)</li>
<li>The default Powershell tab opens, with the title "c:\windows\system32\WindowsPowerShell\v1.0\powershell.exe"</li>
<li>click the <strong>+</strong> button to open a new tab</li>
<li>A second tab opens. the title "c:\windows\system32\WindowsPowerShell\v1.0\powershell.exe" does not fit inside the tab, and is cut off at "...\pow" before the new Tab <em>+</em> button</li>
</ul>
<h1 dir="auto">Expected behavior</h1>
<ul dir="auto">
<li>The <strong>x</strong> to close the second tab would be visible, after the truncated window title, and before the New Tab <strong>+</strong> button, to allow the tab to be closed.</li>
</ul>
<h1 dir="auto">Actual behavior</h1>
<ul dir="auto">
<li>There is no <strong>x</strong> to close the tab available. It is truncated along with the window title.</li>
</ul>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/3262046/62661009-096e0300-b9b3-11e9-93d0-c59b947ef63f.png"><img src="https://user-images.githubusercontent.com/3262046/62661009-096e0300-b9b3-11e9-93d0-c59b947ef63f.png" alt="terminal-preview-tab-noX" style="max-width: 100%;"></a></p>