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

Should the parser save current screen content to history before executing "Erase the screen"? #2

Open
aRe00t opened this issue Apr 15, 2016 · 1 comment

Comments

@aRe00t
Copy link

aRe00t commented Apr 15, 2016

When I checked the output, I found some content are lost, and the number of lost lines is related to Height parameter.

If I set height to 1, e.g. -g 1000x1, it would not lost anything.

After some debugging, I found it is due to two ESC Sequences: <ESC>[H<ESC>[2J.
<ESC>[H will move the cursor to row 0, column 0, and <ESC>[2J will erase the screen.

The two sequences appears serval times in my typescript file, so output will lost Height - 1 lines when parser meet them each time.

@MarkLodato
Copy link
Owner

Thanks for pointing this out!

The standard only says that <ESC>[2J erases the visible screen. xterm does this by simply erasing all the text in the display buffer, so it is not saved to history. VTE (gnome-terminal, xfce-terminal, etc), tmux, and screen instead implement this by scrolling up, so that the display buffer is saved to history. Since the standard does not say anything about the history, both are valid. (To test, use ./rawcat test/t0056-ED.in.)

vt100.py currently has xterm compatibility. I'd be open to having an option to switch between them and think it would be interesting to document the differences, but I can't promise that I'll have time to get to that.

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

No branches or pull requests

2 participants