Skip to content

Lag when opening or exiting programs: Primary Device Attributes query is never answered #21

Closed

Description

@markparonyan

Starting or exiting programs inside a dvtm pane can lag noticeably.

Cause
dvtm never replies to the Primary Device Attributes query (ESC [ c / ESC [ 0 c). The c verb isn't handled in interpret_csi() in vt.c. Many programs send DA1 at startup/exit, often as a sentinel after other queries such as OSC 11 background color or CSI ? u, and then block until a reply comes or a timeout expires. Examples: fish 4, neovim, helix, yazi, and bat/delta (terminal-colorsaurus). A real terminal replies right away, so the same programs start instantly outside dvtm.

Reproduction (query from inside a pane, 2s timeout)

DA1: NO REPLY (timeout 2s)
DSR: b'\x1b[1;0R' in 0.4 ms

Ruled out

  • pane create/destroy path (fork, buffer alloc/free, arrange/redraw): ~3–6 ms per create/exit, same as upstream 7bcf43f
  • no regression from the recent color-pair changes

Fix
Reply to DA1 with ESC [ ? 6 c (VT102, same as st). Leave DA2/DA3 (CSI > c, CSI = c) unanswered so they don't get a DA1-shaped reply.

Side note (not fixed here)
The cursor position report (CSI 6 n) replies with 0-based row/column. It should be 1-based.

Activity

  1. markparonyan commented on Sep 29, 2026

    @markparonyan
    ContributorAuthor

    Fixed in #23 (4ccbbcb): DA1 is answered and DA2/DA3 (CSI > c, CSI = c) are left unanswered, with unit tests in test/test-vt.c. The cursor position report side note is still open.

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