Skip to content

Add support for horizontal margin sequences #14876

@j4james

Description

@j4james

Description of the new feature/enhancement

The DECSLRM escape sequence lets you set left and right margins, so you can wrap your output within a given horizontal range, and also limit the scrolling within those boundaries. This is useful for apps like multiplexers, where you can have two panes side by side, and you need to be able to scroll the one side independently of the other.

Proposed technical implementation details (optional)

There are actually two sequences we need to implement for this. The first is DECLRMM (Left Right Margin Mode), without which the margin functionality won't be active. It's disabled by default because you can't use horizontal margins at the same time as double-width line attributes.

The main sequence is DECSLRM (Set Left Right Margins), which works similarly to the DECSTBM sequence (Set Top Bottom Margins) which we already support. But there a bunch of operations we then need to update to take those margins into account - cursor movement, insert and delete ops, text output, etc.

I should also note that the DECSLRM sequence clashes with the ANSISYSSC sequence which we already support. But the way most modern terminals deal with that is to disable ANSISYSSC when the DECLRMM mode is enabled. So by default CSI s is ANSISYSSC (as we have it now), but with DECLRMM enabled it's interpreted as DECSLRM.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-VTVirtual Terminal sequence supportHelp WantedWe encourage anyone to jump in on these.In-PRThis issue has a related PRIssue-FeatureComplex enough to require an in depth planning process and actual budgeted, scheduled work.Needs-Tag-FixDoesn't match tag requirementsProduct-TerminalThe new Windows Terminal.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions