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

Switch all DSR responses to appending instead of prepending #7583

Merged
2 commits merged into from
Sep 9, 2020

Commits on Sep 9, 2020

  1. Switch all DSR responses to appending instead of prepending

    This fixes an issue where two CPRs could end up corrupted in the input
    buffer. An application that sent two CPRs back-to-back could
    accidentally read the first few characters of the first prepended CPR
    before handing us another CPR. We would dutifully prepend it to the
    buffer, causing them to overlap.
    
    ```
    ^[^[2;2R[1;1R
    ^^      ^^^^^ First CPR
      ^^^^^^ Second CPR
    ```
    
    Response prepending was implemented in !997738 without much comment.
    There's very little in the way of audit trail as to why we switched.
    Michael believes that we wanted to make sure that applications got DSR
    responses immediately.
    
    I discussed our options with him, and he suggested that we could
    implement a priority queue in InputBuffer and make sure that "response"
    input was dispatched to a client application before any application- or
    user-generated input. This was deemed to be too much work.
    
    We decided that DSR responses getting top billing was likely to be a
    stronger guarantee than most terminals are capable of giving, and that
    we should be fine if we just switch it back to append.
    
    Fixes #1637.
    DHowett committed Sep 9, 2020
    1 Configuration menu
    Copy the full SHA
    a49a302 View commit details
    Browse the repository at this point in the history
  2. weave a spell

    DHowett committed Sep 9, 2020
    1 Configuration menu
    Copy the full SHA
    986f20e View commit details
    Browse the repository at this point in the history