[PR #4297] Add support for the HPR and VPR escape sequences #25708

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

Original Pull Request: https://github.com/microsoft/terminal/pull/4297

State: closed
Merged: Yes


Summary of the Pull Request

This PR adds support for the HPR and VPR escape sequences from the VT510 terminal. HPR moves the cursor position forward by a given number of columns, and VPR moves the cursor position downward by a given number of rows. They're similar in function to the CUF and CUD escape sequences, except that they're not constrained by the scrolling margins.

References

#3628 provided the new _CursorMovePosition method that made these operations possible

PR Checklist

Detailed Description of the Pull Request / Additional comments

Most of the implementation is in the new _CursorMovePosition method that was created in PR #3628, so all we're really doing here is hooking up the escape sequences to call that method with the appropriate parameters.

Validation Steps Performed

I've extended the existing state machine tests for CSI cursor movement to confirm that the HPR and VPR sequences are dispatched correctly, and also added screen buffer tests to make sure the movement is clamped by the screen boundaries and not the scrolling margins (we don't yet support horizontal margins, but the test is at least in place for when we do eventually add that support).

I've also checked the HPR and VPR tests in Vttest (under Test non-VT100 / ISO-6429 cursor-movement) and confirmed that they are now working as expected.

**Original Pull Request:** https://github.com/microsoft/terminal/pull/4297 **State:** closed **Merged:** Yes --- ## Summary of the Pull Request This PR adds support for the `HPR` and `VPR` escape sequences from the VT510 terminal. `HPR` moves the cursor position forward by a given number of columns, and `VPR` moves the cursor position downward by a given number of rows. They're similar in function to the `CUF` and `CUD` escape sequences, except that they're not constrained by the scrolling margins. ## References #3628 provided the new `_CursorMovePosition` method that made these operations possible ## PR Checklist * [x] Closes #3428 * [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: #xxx ## Detailed Description of the Pull Request / Additional comments Most of the implementation is in the new `_CursorMovePosition` method that was created in PR #3628, so all we're really doing here is hooking up the escape sequences to call that method with the appropriate parameters. ## Validation Steps Performed I've extended the existing state machine tests for CSI cursor movement to confirm that the `HPR` and `VPR` sequences are dispatched correctly, and also added screen buffer tests to make sure the movement is clamped by the screen boundaries and not the scrolling margins (we don't yet support horizontal margins, but the test is at least in place for when we do eventually add that support). I've also checked the `HPR` and `VPR` tests in Vttest (under _Test non-VT100 / ISO-6429 cursor-movement_) and confirmed that they are now working as expected.
claunia added the pull-request label 2026-01-31 09:11:16 +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#25708