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

DECSTBM issues #2355

Merged
merged 7 commits into from Aug 7, 2019
Merged

DECSTBM issues #2355

merged 7 commits into from Aug 7, 2019

Conversation

jerch
Copy link
Member

@jerch jerch commented Aug 2, 2019

Fixes #2354, fixes #2306.

@Tyriar Note that our way to annotate wrapped lines might get problems here:

if (buffer.y >= this._bufferService.rows) {
buffer.y = this._bufferService.rows - 1;
}
// The line already exists (eg. the initial viewport), mark it as a
// wrapped line
buffer.lines.get(buffer.y).isWrapped = true;
}

We set the flag at the new line indicating that it belongs to the previous line, which might mark the last line in viewport as wrapped if we are out of the scroll region. Imho we should set this flag the way around at the leading line meaning that it continues with the next line. I did not change this yet as it would pull in tons of chances in reflow and scroll handling. Btw the problem we have with CBT after RI + IND is also related to this. Same with the issue #1882.

--> Created separate tracking issue #2359.

@@ -27,5 +27,5 @@ r
s
t
uvwxyz

Copy link
Member

@Tyriar Tyriar Aug 2, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't these files not change? We can fork them into new ones if we need slight modifications?

Copy link
Member Author

@jerch jerch Aug 2, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This had to change since the original terminal assumed 80x24, but we test with 80x25. This particular change is needed to reset the scroll bottom to viewport bottom again. Yes we can fork them into new files, if the old test is still relevant (which is not the case here).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did we change it to 25?

Copy link
Member Author

@jerch jerch Aug 2, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests were with 25 since I imported them to xterm.js. The 24 to 25 switch happened before that (with my own emulator), cant remember why I changed it in the first place.

Thus all expected results had to be converted (with the python script you can basically run all tests in xterm and grab the viewport output as .text file).

While fixing this issue I just saw that the .text was not rebuild (still containing the plain \n staggering, while we test via pty with \r\n), so I did this to find out that the test does not do the last part correctly due to 24 to 25 switch, thus I had to change the .in file too.

I think some of the not working test files are also not yet converted correctly, gonna fix them when getting to the issues. Doing this file by file with real issues at hand its easier to ensure that the tests actually test the right stuff.

src/Terminal2.test.ts Outdated Show resolved Hide resolved
@jerch
Copy link
Member Author

jerch commented Aug 3, 2019

@Tyriar DECSTBM + IND was fixable the same way. Again the test files had to be modified to test all aspects.

@jerch
Copy link
Member Author

jerch commented Aug 4, 2019

@Tyriar Done with DECSTBM, passes now all margin top/bottom related tests. Also fixes #2306.

Note that CBT after RI + IND still fails and prolly needs the change in the wrap flag as described above, tracked in #2359.

@jerch jerch changed the title fix DECSTBM with LF DECSTBM issues Aug 4, 2019
@jerch jerch self-assigned this Aug 4, 2019
Copy link
Member

@Tyriar Tyriar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to work and test coverage improved 👍

@Tyriar Tyriar merged commit 58e1b0d into xtermjs:master Aug 7, 2019
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

Successfully merging this pull request may close these issues.

ANSI scrollable region seems slightly broken. DECSTBM has margin issues
2 participants