Skip to content

xterm-addon-serialize only serialize the alt screen if the terminal is in alt mode #3090

@mmis1000

Description

@mmis1000

Details

Steps to reproduce

  1. create a empty terminal
  2. install the xterm-addon-serialize
  3. write the following string into it
    const SMCUP = '\u001b[?1049h'; // enable alternative screen
    const CUP = '\u001b[H'; // move  cursor to top left
    terminal.write(`1${SMCUP}${CUP}2`)
  1. read the result using serializeAddon.serialize()

Expect

You get the normal screen + alt screen in the result.
(Not sure which sequence is used to move the cursor, because there are too many ways to do it)

Actually

You get 2
The addon did not realize there is another screen exist.

Note

I am not sure whether is it designed to not do it or not.
But the normal screen is required to rebuild the terminal from empty (or exit the htop will no longer bring you back to original prompt), so I guess it is missing?

I play with it a bit. /src/SerializeAddon.ts#L192-L201k

And if it should do it

  1. whether it is always enabled or expose as a option?
  2. do alt screen affected by the rows option?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions