Skip to content

Add support for Presentation State reports #14984

Description

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.

Activity

  1. added
    Issue-FeatureComplex enough to require an in depth planning process and actual budgeted, scheduled work.
    on Mar 12, 2023
  2. added
    Needs-Tag-FixDoesn't match tag requirements
    Needs-TriageIt's a new issue that the core contributor team needs to triage at the next triage meeting
    on Mar 12, 2023
  3. j4james commented on Mar 12, 2023

    @j4james
    CollaboratorAuthor

    Tony Lawrence (@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:
    https://gist.github.com/j4james/a25e6290772353c06f85c584007c2aa0

    And this one is for the cursor information report:
    https://gist.github.com/j4james/570a9b7dd28dbdd8b626be2770567210

  4. j4james commented on Mar 12, 2023

    @j4james
    CollaboratorAuthor

    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.

  5. al20878 commented on Mar 12, 2023

    @al20878

    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.

  6. al20878 commented on Mar 12, 2023

    @al20878

    Unfortunately, I'm having issues with these two... The first one (dectabsr.sh) makes the terminal reset and then appears like it also generates some garbage on the screen. Attaching the final pic, but I also shot a video of how it's run.

    dectabsr

    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):

    deccir

  7. j4james commented on Mar 12, 2023

    @j4james
    CollaboratorAuthor

    Tony Lawrence (@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.

  8. j4james commented on Mar 12, 2023

    @j4james
    CollaboratorAuthor

    Tony Lawrence (@al20878) I've uploaded a revision of the dectabsr script with a one second delay after each column mode change, and a longer timeout on the report reader. Hopefully that should work better. When you have a chance, I'd appreciate you trying it again.

    https://gist.github.com/j4james/a25e6290772353c06f85c584007c2aa0

  9. al20878 commented on Mar 13, 2023

    @al20878

    Indeed, the new version runs absolutely clean (I mean I can now tell that the terminal switches between the modes, because previously it was just blinking like it was reset a couple times; also no garbage on screen). The result:
    dectabsr

  10. j4james commented on Mar 13, 2023

    @j4james
    CollaboratorAuthor

    Tony Lawrence (@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. 😉

  11. al20878 commented on Mar 13, 2023

    @al20878

    No problem, James Holderness (@j4james)! I was happy to help :-)
    Please feel free to reach out if you need any further testing. And good luck!

  12. added
    Help WantedWe encourage anyone to jump in on these.
    Area-VTVirtual Terminal sequence support
    Issue-TaskIt's a feature request, but it doesn't really need a major design.
    and removed
    Issue-FeatureComplex enough to require an in depth planning process and actual budgeted, scheduled work.
    Needs-TriageIt's a new issue that the core contributor team needs to triage at the next triage meeting
    on Mar 13, 2023
  13. added a commit that references this issue on Mar 23, 2023
    0f7d1f4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-VTVirtual Terminal sequence supportHelp WantedWe encourage anyone to jump in on these.In-PRThis issue has a related PRIssue-TaskIt's a feature request, but it doesn't really need a major design.Needs-Tag-FixDoesn't match tag requirements

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions