Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ansi): XTWINOPS and WindowOp functions #323

Merged
merged 1 commit into from
Jan 13, 2025
Merged

feat(ansi): XTWINOPS and WindowOp functions #323

merged 1 commit into from
Jan 13, 2025

Conversation

aymanbagabas
Copy link
Member

This implements the XTWINOPS and WindowOp functions that allow manipulating the terminal window. Using ansi.WindowOp with ReportWindowSizeWinOp, we can query the terminal for the pixel size of the window. This is useful for rendering images in the terminal and calculate the cell size based on how many pixels and cells are available.

See https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h4-Functions-using-CSI-_-ordered-by-the-final-character-lparen-s-rparen:CSI-Ps;Ps;Ps-t.1EB0

This implements the XTWINOPS and WindowOp functions that allow
manipulating the terminal window. Using `ansi.WindowOp` with
`ReportWindowSizeWinOp`, we can query the terminal for the pixel size of
the window. This is useful for rendering images in the terminal and
calculate the cell size based on how many pixels and cells are available.

See https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h4-Functions-using-CSI-_-ordered-by-the-final-character-lparen-s-rparen:CSI-Ps;Ps;Ps-t.1EB0
@aymanbagabas aymanbagabas requested a review from caarlos0 January 13, 2025 06:45
@aymanbagabas aymanbagabas merged commit d87966b into main Jan 13, 2025
8 checks passed
@aymanbagabas aymanbagabas deleted the winop branch January 13, 2025 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants