Skip to content

Inline startup waits up to 1 s for kitty keyboard / OSC 10/11 replies that conhost never sends #5690

Description

@robsonfelix

Summary

In AppModel.Inline, the first frame waits up to 1 s on terminals that don't answer the kitty keyboard query (CSI ? u). The Windows console host (conhost) and several SSH/ConPTY setups never answer it.

The terminal-colours query (OSC 10/11) has its own 1 s timeout, and the inbox console host doesn't forward it either. So on those terminals a 1 s delay before first paint is the norm.

Observed

Time to first frame, measured with a ConPTY harness:

Setup Time to first frame
Our inline host, inbox conhost ~1.2 s
Kitty probe released once the DA1 reply has arrived kitty wait removed
Colour query also released on DA1 ~310–380 ms

The kitty probe can't be skipped through configuration: the 1 s timeout is a private static. Only the legacy-console path bypasses it.

Workaround we use

IApplication.AnsiStartupGate is public, and so is its MarkComplete(AnsiStartupQuery.KittyKeyboard). After Init(), a short AddTimeout poll marks the kitty query complete once the DA1 (device attributes) reply has arrived.

This is safe because DA1 is queried after the kitty query and terminals answer in order: a kitty-capable terminal always replies before DA1. A late kitty reply still enables the protocol.

Request

  1. End the kitty probe when the DA1 reply arrives first, or make the probe optional or configurable (for example Application.StartupProbes / a timeout setting).
  2. Treat the OSC 10/11 colour query the same way: if DA1 is answered and the colour query isn't, assume no reply is coming and render with default colours.
  3. Optionally expose the timeouts as configuration rather than private statics.

Environment

  • Terminal.Gui 2.5.0, .NET 10.
  • Windows 11: conhost, ConPTY and Windows Terminal.

Activity

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

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions