Add support for horizontal scrolling sequences #19635

Closed
opened 2026-01-31 06:49:23 +00:00 by claunia · 1 comment
Owner

Originally created by @j4james on GitHub (Apr 4, 2023).

Originally assigned to: @j4james on GitHub.

Description of the new feature/enhancement

There are a number of VT sequences that were introduced by the VT420, which provide a way for applications to scroll the screen horizontally.

There's DECFI (forward index) and DECBI (backward index), which are the horizontal equivalents of the IND (index) and RI (reverse index) operations. They move the cursor position forward or backwards by one column, but once you reach the edge of the screen (or margin area), the buffer is forced to scroll.

There's also DECIC (insert column) and DECDC (delete column), which are the horizontal equivalents of the IL (insert line) and DL (delete line) operations. As the names suggest, they insert or delete a column at the active cursor position, forcing the area to the right of that to scroll forward or backward.

My main motivation for adding them is because they're useful for optimizing side-scrolling games. But the other reason is that they're necessary to meet the requirements of the horizontal scrolling extension (along with the horizontal margin operations from PR #15084).

Proposed technical implementation details (optional)

Once PR #15084 is done (assuming that's accepted), the implementation for these ops should be fairly trivial. It's mostly a matter of calling the existing _ScrollRectHorizontally method with the appropriate coordinates.

Originally created by @j4james on GitHub (Apr 4, 2023). Originally assigned to: @j4james on GitHub. # Description of the new feature/enhancement There are a number of VT sequences that were introduced by the VT420, which provide a way for applications to scroll the screen horizontally. There's `DECFI` (forward index) and `DECBI` (backward index), which are the horizontal equivalents of the `IND` (index) and `RI` (reverse index) operations. They move the cursor position forward or backwards by one column, but once you reach the edge of the screen (or margin area), the buffer is forced to scroll. There's also `DECIC` (insert column) and `DECDC` (delete column), which are the horizontal equivalents of the `IL` (insert line) and `DL` (delete line) operations. As the names suggest, they insert or delete a column at the active cursor position, forcing the area to the right of that to scroll forward or backward. My main motivation for adding them is because they're useful for optimizing side-scrolling games. But the other reason is that they're necessary to meet the requirements of the horizontal scrolling extension (along with the horizontal margin operations from PR #15084). # Proposed technical implementation details (optional) Once PR #15084 is done (assuming that's accepted), the implementation for these ops should be fairly trivial. It's mostly a matter of calling the existing `_ScrollRectHorizontally` method with the appropriate coordinates.
claunia added the Help WantedProduct-ConhostIssue-TaskIn-PRArea-VT labels 2026-01-31 06:49:23 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Apr 17, 2023):

Yep sounds good to us!

@zadjii-msft commented on GitHub (Apr 17, 2023): Yep sounds good to us!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#19635