Skip to content

A late response to a secondary DA request gets passed on to the client #2984

Closed

Description

@romkatv

If the outer TTY takes longer than a second to reply to [>0c (secondary DA request), the eventual reply (e.g., \033[>0;10;1c) gets passed to the client and may end up in unexpected places -- perhaps in a file that one has opened in an editor.

Execution flow goes like this:

  1. tmux starts.
  2. tmux sends [>0c to the outer TTY (tty_send_requests) and starts a 1s timer.
  3. when the timer expires (tty_start_timer_callback), tmux sets TTY_HAVEDA bit.
  4. when the reply eventually arrives, tty_keys_device_attributes doesn't look at it because TTY_HAVEDA is set.

Unfortunately, I don't have logs. I've reconstructed this from a bug report from a user of my code (romkatv/zsh4humans#177 (comment)).

Activity

  1. nicm commented on Nov 22, 2021

    @nicm
    Member

    What terminal takes more than a second to respond to this?

  2. romkatv commented on Nov 22, 2021

    @romkatv
    Author

    I don't know which terminal but it's on Windows 11. I'm 100% with you that it's not normal for a terminal to take over a second to reply. My response from the bug I linked above:

    A proper fix would be to figure out why your terminal takes so long to reply and fix it.

    I've implemented a workaround in my code so that \033[>0;10;1c at random times doesn't break me. I've opened this issue in case you'll find this information useful. It's fine with me if you deprioritize or close it.

  3. nicm commented on Nov 22, 2021

    @nicm
    Member

    We can probably bump it to 2 or 5 seconds or something, I'll take a look next week.

  4. shah commented on Nov 23, 2021

    @shah

    @nicm this was happening for me on Windows 11 using Windows Terminal 1.11.2921.0. @romkatv was kind enough to fix the problem in his package so this is not an urgent priority but I suspect, especially given the growth of Windows Terminal (it's now "built-into" Windows 11) others may see it soon too.

  5. nicm commented on Nov 29, 2021

    @nicm
    Member

    I have bumped the timeout to three seconds, the change will be in GitHub when it syncs later on. If this still happens I think you will need to either live with it or talk to the terminal developers about why it is taking so long. Thanks!

  6. github-actions commented on Dec 30, 2021

    @github-actions

    This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  7. locked as resolved and limited conversation to collaborators on Dec 30, 2021
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions