Skip to content

Report Avalonia cell pixel dimensions so server-sized MXP images retain aspect ratio #124

Closed

Description

@HarryCordewener

Verified reproduction

Follow-up to merged #122. That change fixes dimensions calculated locally but correctly preserves explicit MXP W/H character dimensions. SharpMUSH lays out its default CONNECT logo in a 33-column figure and sends both dimensions, so it also needs the client's actual cell geometry.

An isolated test using SharpMUSH's actual rendering worker and default 512×512 assets/logo.png produced:

  • Unknown cell pixels: <IMAGE ... W=33c H=17c> (server fallback 10×20).
  • Reported 10×24 cells: <IMAGE ... W=33c H=14c>.
  • Reported 16×40 cells: <IMAGE ... W=32c H=13c>.

On a 10×24 client the unknown-metric box renders as 330×408 pixels, rather than approximately square. Correct geometry gives 330×336, within whole-cell rounding.

Cause and scope

SharpMUTerm sends NAWS character dimensions but does not answer the server's CSI 16 t cell-pixel query. Its text parser discards non-SGR CSI sequences, and the telnet session currently has no pixel-query responder. SharpMUSH's pinned TNC 4.8 already accepts CSI 6 ; height ; width t and carries those dimensions into initial and subsequent render capabilities.

The Avalonia scrollbar is an overlay, not a deducted layout gutter. A separate runtime pane/NAWS comparison matched dimensions, including overflowing scrollback. This issue is about missing pixel geometry, not image stripes. The reproduction establishes the bug independently; it does not establish which exact metrics or build produced the user's screenshot.

Expected fix and verification

Answer cell-size queries with current measured geometry at the telnet byte-stream layer, before line buffering; refresh geometry when zoom/font metrics change. Keep explicit server cell reservations intact. Test fragmented queries, no-newline negotiation, unavailable metrics, later metric updates, and server rendering. No SharpConsoleUI changes are needed.

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