[PR #3368] [MERGED] Add support for the HPA escape sequence #25330

Open
opened 2026-01-31 09:08:47 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/3368
Author: @j4james
Created: 10/29/2019
Status: Merged
Merged: 10/31/2019
Merged by: @zadjii-msft

Base: masterHead: feature-hpa


📝 Commits (2)

  • 1d75574 Add support for the HPA escape sequence as an alias for CHA.
  • 4d041ad Extend the output engine tests for cursor movement to confirm that HPA is dispatched in the same way as CHA.

📊 Changes

3 files changed (+7 additions, -0 deletions)

View changed files

📝 src/terminal/parser/OutputStateMachineEngine.cpp (+2 -0)
📝 src/terminal/parser/OutputStateMachineEngine.hpp (+1 -0)
📝 src/terminal/parser/ut_parser/OutputEngineTest.cpp (+4 -0)

📄 Description

Summary of the Pull Request

HPA (horizontal position absolute) is just an alias for the existing CHA (cursor horizontal absolute) escape sequence, which moves the cursor position to the specified column on the current line. This is needed in order to pass the HPA test in Vttest.

PR Checklist

Detailed Description of the Pull Request / Additional comments

As discussed in issue #3348, the general consensus is that this can be considered an alias for the CHA escape sequence. So I've just added a new entry in the VTActionCodes enum for the HPA final character, and then updated the switch statements in OutputStateMachineEngine::ActionCsiDispatch to share the same code path as the existing CHA action.

I haven't bothered with giving it a unique telemetry code, since we haven't done that for the CUP and HVP codes either, so I assumed that would be OK.

Validation Steps Performed

I've extended the existing output engine tests for CSI cursor movement to confirm that HPA is dispatched in the same way as CHA. I've also checked the HPA test in Vttest (under Test non-VT100 / ISO-6429 cursor-movement) and confirmed that it is now working as expected.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/3368 **Author:** [@j4james](https://github.com/j4james) **Created:** 10/29/2019 **Status:** ✅ Merged **Merged:** 10/31/2019 **Merged by:** [@zadjii-msft](https://github.com/zadjii-msft) **Base:** `master` ← **Head:** `feature-hpa` --- ### 📝 Commits (2) - [`1d75574`](https://github.com/microsoft/terminal/commit/1d75574c6d935ad09d01ef426ad2f81ad09954b7) Add support for the HPA escape sequence as an alias for CHA. - [`4d041ad`](https://github.com/microsoft/terminal/commit/4d041ade47afce57bd8ea93fc973b51cf5db9cce) Extend the output engine tests for cursor movement to confirm that HPA is dispatched in the same way as CHA. ### 📊 Changes **3 files changed** (+7 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `src/terminal/parser/OutputStateMachineEngine.cpp` (+2 -0) 📝 `src/terminal/parser/OutputStateMachineEngine.hpp` (+1 -0) 📝 `src/terminal/parser/ut_parser/OutputEngineTest.cpp` (+4 -0) </details> ### 📄 Description ## Summary of the Pull Request [`HPA`](https://vt100.net/docs/vt510-rm/HPA.html) (horizontal position absolute) is just an alias for the existing [`CHA`](https://vt100.net/docs/vt510-rm/CHA.html) (cursor horizontal absolute) escape sequence, which moves the cursor position to the specified column on the current line. This is needed in order to pass the `HPA` test in [Vttest](https://invisible-island.net/vttest/). <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist * [x] Closes #3348 * [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [x] Tests added/passed * [ ] Requires documentation to be updated * [ ] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #3348 <!-- Provide a more detailed description of the PR, other things fixed or any additional comments/features here --> ## Detailed Description of the Pull Request / Additional comments As discussed in issue #3348, the general consensus is that this can be considered an alias for the `CHA` escape sequence. So I've just added a new entry in the `VTActionCodes` enum for the `HPA` final character, and then updated the switch statements in `OutputStateMachineEngine::ActionCsiDispatch` to share the same code path as the existing `CHA` action. I haven't bothered with giving it a unique telemetry code, since we haven't done that for the `CUP` and `HVP` codes either, so I assumed that would be OK. <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed I've extended the existing output engine tests for CSI cursor movement to confirm that `HPA` is dispatched in the same way as `CHA`. I've also checked the `HPA` test in Vttest (under _Test non-VT100_ / _ISO-6429 cursor-movement_) and confirmed that it is now working as expected. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:08:47 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#25330