-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Add support for Presentation State reports #14984
Comments
@al20878 I've got another couple of tests which I'd previously created for these reports. They were written as bash scripts, though, so just let me know if that's a problem and I can rewrite them in Python. Also, note that they don't actually log anything, the results are displayed on the screen, so I'd be grateful if you could take a photograph of each run and post that here. This is for the tab stop report: And this one is for the cursor information report: |
I forgot to say, I'd ideally like to see this run on a VT525 - specifically the cursor information report - because I think it might include additional information for the active SGR colors that other terminals wouldn't include. |
Shell scripts are fine, I'll be running them on Linux (Raspbian), so it's all good, I hope. Downloaded both, will post the results. |
Unfortunately, I'm having issues with these two... The first one ( The other one, too, appears to behave erratically but not as bad. The final screenshot is here (and, there's a video as well, I'll post the links to both in a few): |
@al20878 Thanks again. This is very useful. The cursor information report (the second one) is perfect. I think the weirdness you're seeing is just the test doing it's thing. It's moving the cursor to different positions on the screen, changing the active page, and setting margins, etc. and all the while it's requesting reports from the terminal which take a couple seconds. The final result is exactly what I was expecting to see. I had hoped there might also be color information, but that wasn't the case. I think the problem with the first one is that I'm switching back and forth between 80 columns and 132 columns, and I suspect I need to give the terminal time to make that switch before throwing queries at it. If it's not ready to respond fast enough, the report reader probably times out, and the report then ends up written on to the screen. I'll try and make some adjustments to the script to see if I can fix the issue and let you know when I have another version ready to test. |
@al20878 I've uploaded a revision of the https://gist.github.com/j4james/a25e6290772353c06f85c584007c2aa0 |
@al20878 Perfect. That tells me everything I needed to know. Thank you so much for doing all this testing. This is going to keep me busy for a while, so I'll leave you in peace for a bit. 😉 |
No problem, @j4james! I was happy to help :-) |
This PR introduces two new sequences, `DECRQPSR` and `DECRSPS`, which provide a way for applications to query and restore the presentation state reports. This includes the tab stop report (`DECTABSR`) and the cursor information report (`DECCIR`). One part of the cursor information report contains the character set designations and mapped G-sets. But we weren't tracking that data in a way that could easily be reported, so I needed to do some refactoring in the `TerminalOutput` class to make that accessible. Other than that, the rest was fairly straightforward. It was just a matter of packaging up all the information into the correct format for the returned `DCS` string, and in the case of the restore operations, parsing the incoming data and applying the new state. ## Validation Steps Performed Thanks to @al20878, we were able to test these operations on a real VT525, and I've manually verified that our implementation matches that behavior. I've also added some unit tests covering both reports. Closes #14984
## Summary of the Pull Request This PR adds support for the `DECST8C` escape sequence, which resets the tab stops to every 8 columns. ## Detailed Description of the Pull Request / Additional comments This is actually a private parameter variant of the ANSI `CTC` sequence (Cursor Tabulation Control), which accepts a selective parameter which specifies the type of tab operation to be performed. But the DEC variant only defines a single parameter value (5), which resets all tab stops. It also considers an omitted parameter to be the equivalent of 5, so we support that too. ## Validation Steps Performed I've extended the existing tab stop tests in `ScreenBufferTests` with some basic coverage of this sequence. I've also manually verified that the `DECTABSR` script in #14984 now passes the `DECST8C` portion of the test. ## PR Checklist - [x] Closes #16533 - [x] Tests added/passed
## Summary of the Pull Request This PR adds support for the `DECST8C` escape sequence, which resets the tab stops to every 8 columns. ## Detailed Description of the Pull Request / Additional comments This is actually a private parameter variant of the ANSI `CTC` sequence (Cursor Tabulation Control), which accepts a selective parameter which specifies the type of tab operation to be performed. But the DEC variant only defines a single parameter value (5), which resets all tab stops. It also considers an omitted parameter to be the equivalent of 5, so we support that too. ## Validation Steps Performed I've extended the existing tab stop tests in `ScreenBufferTests` with some basic coverage of this sequence. I've also manually verified that the `DECTABSR` script in #14984 now passes the `DECST8C` portion of the test. ## PR Checklist - [x] Closes #16533 - [x] Tests added/passed (cherry picked from commit f589888) Service-Card-Id: 91631721 Service-Version: 1.19
Description of the new feature/enhancement
There are two reports that can be queried with the
DECRQPSR
(request presentation state) escape sequence. The one returns the active tab stops, and the other returns what they call "cursor information", which includes things like cursor position, SGR attributes, and character set designations.There is also then a corresponding
DECRSPS
sequence (restore presentation state) which can restore the saved information from the above mentioned reports.There are a number of uses for these sequences, but the main reason I want to support them is because they're needed to meet the requirements of the TSI (terminal state interrogation) feature, which is itself a requirement for level 3 compliance.
Proposed technical implementation details (optional)
This will require some additional work in the
TerminalOuput
class to track the actual IDs of the designated character sets so we can return that information in the report. I think most of the other information we need should be easy to access.The text was updated successfully, but these errors were encountered: