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

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

Closed
mmis1000 opened this issue Sep 13, 2020 · 1 comment · Fixed by #3101
Closed
Labels
area/addon/serialize help wanted type/enhancement Features or improvements to existing features

Comments

@mmis1000
Copy link
Contributor

mmis1000 commented Sep 13, 2020

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?
@Tyriar
Copy link
Member

Tyriar commented Sep 14, 2020

Your changes seem like a good idea.

whether it is always enabled or expose as a option?

Always would probably be fine

do alt screen affected by the rows option?

The alt screen has no scrollback, so we could always serialize the whole thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/addon/serialize help wanted type/enhancement Features or improvements to existing features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants