<h1 dir="auto">Environment</h1>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Windows build number: 10.0.18950.1000
Windows Terminal version (if applicable): 0.3.2142.0 (from Microsoft Store)

Any other software?
Not a software, but I'm using GitHub authentication with Microsoft Account."><pre lang="none" class="notranslate"><code class="notranslate">Windows build number: 10.0.18950.1000
Windows Terminal version (if applicable): 0.3.2142.0 (from Microsoft Store)

Any other software?
Not a software, but I'm using GitHub authentication with Microsoft Account.
</code></pre></div>
<h1 dir="auto">Steps to reproduce</h1>
<p dir="auto">I tried to use Azure CloudShell Connector, but the connector shows an error message like below.</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/35712113/62438852-4a340500-b784-11e9-8ba3-954ae121b17e.png"><img width="737" alt="issue" src="https://user-images.githubusercontent.com/35712113/62438852-4a340500-b784-11e9-8ba3-954ae121b17e.png" style="max-width: 100%;"></a></p>
<h1 dir="auto">Expected behavior</h1>
<p dir="auto">I think it should work normally.</p>
<h1 dir="auto">Actual behavior</h1>
<p dir="auto">I captured traffic with Fiddler4. The OAUTH API returns 400 error code like below. The API says <code class="notranslate">AADSTS70016: Pending end-user authorization.</code>. I don't know what causes the error after authentication is complete, but authentication fails as shown in the attached screenshot.</p>
<p dir="auto">If there are any conditions or circumstances that prevent the device from logging in, it may be necessary to provide guidance on how to respond appropriately.</p>
<p dir="auto">Request</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="POST https://login.microsoftonline.com/common/oauth2/token HTTP/1.1
Connection: Keep-Alive
Content-Type: application/x-www-form-urlencoded; charset=utf-8
User-Agent: cpprestsdk/2.10.13
Content-Length: 328
Host: login.microsoftonline.com
Cookie: stsservicecookie=ests; x-ms-gateway-slice=prod; fpc=...

grant_type=device_code&amp;resource=https://management.core.windows.net/&amp;client_id=...&amp;code=..."><pre class="notranslate"><code class="notranslate">POST https://login.microsoftonline.com/common/oauth2/token HTTP/1.1
Connection: Keep-Alive
Content-Type: application/x-www-form-urlencoded; charset=utf-8
User-Agent: cpprestsdk/2.10.13
Content-Length: 328
Host: login.microsoftonline.com
Cookie: stsservicecookie=ests; x-ms-gateway-slice=prod; fpc=...

grant_type=device_code&amp;resource=https://management.core.windows.net/&amp;client_id=...&amp;code=...
</code></pre></div>
<p dir="auto">Response:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{&quot;error&quot;:&quot;authorization_pending&quot;,&quot;error_description&quot;:&quot;AADSTS70016: Pending end-user authorization.\r\nTrace ID: 020679d0-f785-40be-b55c-b6dfa9029500\r\nCorrelation ID: 2de85d18-59f3-44b5-8e91-aa9ada0412b8\r\nTimestamp: 2019-08-05 04:19:27Z&quot;,&quot;error_codes&quot;:[70016],&quot;timestamp&quot;:&quot;2019-08-05 04:19:27Z&quot;,&quot;trace_id&quot;:&quot;020679d0-f785-40be-b55c-b6dfa9029500&quot;,&quot;correlation_id&quot;:&quot;2de85d18-59f3-44b5-8e91-aa9ada0412b8&quot;}"><pre class="notranslate"><code class="notranslate">{"error":"authorization_pending","error_description":"AADSTS70016: Pending end-user authorization.\r\nTrace ID: 020679d0-f785-40be-b55c-b6dfa9029500\r\nCorrelation ID: 2de85d18-59f3-44b5-8e91-aa9ada0412b8\r\nTimestamp: 2019-08-05 04:19:27Z","error_codes":[70016],"timestamp":"2019-08-05 04:19:27Z","trace_id":"020679d0-f785-40be-b55c-b6dfa9029500","correlation_id":"2de85d18-59f3-44b5-8e91-aa9ada0412b8"}
</code></pre></div>
<h1 dir="auto">Description of the new feature/enhancement</h1>
<p dir="auto"><a href="https://vt100.net/docs/vt510-rm/HPA.html" rel="nofollow"><code class="notranslate">HPA</code></a> is an escape sequence for setting the horizontal cursor position.</p>
<p dir="auto">Technically there is a distinction between <code class="notranslate">HPA</code>, which sets the data position, and <a href="https://vt100.net/docs/vt510-rm/CHA.html" rel="nofollow"><code class="notranslate">CHA</code></a>, which sets the presentation position (at least according to ECMA-048). However, I believe that only applies to bidirectional environments, and from what I've seen, it looks like most terminal emulators just treat them as synonyms.</p>
<p dir="auto">Since we already support <code class="notranslate">CHA</code>, this doesn't really provide us with any new functionality, but it is one of the sequences tested by <a href="https://invisible-island.net/vttest/" rel="nofollow">Vttest</a>, so it would be nice to support, and it should be trivial to add.</p>
<h1 dir="auto">Proposed technical implementation details (optional)</h1>
<ol dir="auto">
<li>Add a new entry in the <a href="https://github.com/microsoft/terminal/blob/08464648f280624023d3572346a75dee7a428de8/src/terminal/parser/OutputStateMachineEngine.hpp#L85"><code class="notranslate">VTActionCodes</code></a> enum.</li>
<li>Update the <a href="https://github.com/microsoft/terminal/blob/a82d6b8c69f6e4b2fe946097da0e4c403cb42100/src/terminal/parser/OutputStateMachineEngine.cpp#L279"><code class="notranslate">OutputStateMachineEngine::ActionCsiDispatch</code></a> method to treat that new code as a synonym for the existing <code class="notranslate">CHA_CursorHorizontalAbsolute</code>.</li>
</ol>
<p dir="auto">If you care about tracking it as a separate telemetry entry, that would require a little more duplication of code, but it's still fairly trivial.</p>