Skip to content

Implementation issue about xterm-addon-serialize #3093

Closed
@mmis1000

Description

@mmis1000

Details

Steps to reproduce

I took a try on implement the todo items in xterm-addon-serialize
And I find a few issue.
(This issue may better be classified a question. But it seems it is weird to ask this is SO as this is not a usage question.)

The rows option

It looks like you can have a rows option smaller than Terminal.rows

But I find the cursor position restoration will be pointless if you set it like that.
That said, you have a 6 * 3 terminal, the cursor is on line 1, text in line 2

----------
| _      |
| 123    |
|        |
----------

_   cursor
123 text

And you serialize with rows 1, and you restore it.
You now get one line 123.

----------
| 123    |
|        |
|        |
----------

_   cursor
123 text

But where should you place the cursor? The cursor position(on the top of 123) is out of screen now.

The rows interface with the isWrapped

If the isWrapped is considered in serialization (concat the next line to first one if they are the same line that got wrapped).

  1. whether the concatenated line counted as 2 line or 1 line?
  2. How should the terminal be serialized when a wrapped line is cropped by the rows option?

The coordinate of cursor.

How should the cursor position restored?

If you write the result into different sized terminal.
The cursor position may looks pointless in one of the way (depends on usage).

  1. By relative position
    move 1 row down, move 1 col right from the last word in the result.
  2. By absolute screen space position
    move to screen postion 4, 8.
  3. Does not matter because the result isn't designed to write into terminal that have different size.

Metadata

Metadata

Assignees

Labels

type/questionA question on how to use the library

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions