Skip to content

Is it possible to get the character in a specific cell? #5040

Closed Answered by jerch
ValerioB88 asked this question in Q&A
Discussion options

You must be logged in to vote

Yes it is possible, e.g. term.buffer.active.getLine(0).getCell(0).getChars() would give you the characters at cell [0, 0] on the active buffer.

Also see

xterm.js/typings/xterm.d.ts

Lines 1463 to 1699 in 1709d44

interface IBuffer {
/**
* The type of the buffer.
*/
readonly type: 'normal' | 'alternate';
/**
* The y position of the cursor. This ranges between `0` (when the
* cursor is at baseY) and `Terminal.rows - 1` (when the cursor is on the
* last row).
*/
readonly cursorY: number;
/**
* The x position of the cursor. This ranges between `0` (left side) and
* `Terminal.cols` (after last cell of …

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by jerch
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants