Skip to content

Report measured terminal cell pixels through opt-in TNC queries - #126

Merged
HarryCordewener merged 6 commits into
mainfrom
fix/terminal-cell-query
Nov 9, 2026
Merged

HarryCordewener merged 6 commits into
mainfrom
fix/terminal-cell-query

Conversation

@HarryCordewener

@HarryCordewener HarryCordewener commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Summary

Fixes #124.

SharpMUSH asks for physical cell pixels with CSI 16 t. Without a response it falls back to assumed cell proportions, so server-specified image boxes can stretch in the desktop renderer. This change supplies measured host geometry through TNC's opt-in terminal-query plugin.

  • Opt into TerminalQueryProtocol.WithCellSizeProvider; TNC owns parsing, control-string shielding, replies and refresh ordering. No client-owned CSI parser or generic byte hook.
  • Publish actual Avalonia font cell pixels through a dedicated ClientHost metrics channel, independent of pointer presentation.
  • Refresh interested peers after zoom, display-scale changes, and connection completion, including changes that leave the character grid unchanged.
  • In Unix terminal mode, read published terminal pixel extents through ioctl without reading terminal input; poll for pixel-only changes and stop on shutdown. Missing, invalid or inexact measurements remain unknown. Windows pseudoconsole metrics remain unknown rather than reporting a virtual console's misleading font size.
  • Update TelnetNegotiationCore to released NuGet 4.9.0, containing Add opt-in client terminal cell-size responder HarryCordewener/TelnetNegotiationCore#182. No SharpConsoleUI changes.

Validation

  • Forced uncached normal NuGet restore, clean and Release solution build passed with no local project override. Restored TNC and TNC.Gmcp are both 4.9.0 packages. One existing nullable warning in ListEditorTests.cs:191.
  • Full suites: Core 1736/1736, Client 245/245, Graphics 99/99, Scripting 92/92, Web 37/37, Tui 3030/3030; Avalonia 924/924, repeated twice. All 6163 tests pass.
  • Fixed the aggregate NativePanel timing failure: modal-state notifications are asynchronous, and a fullscreen modal prevents the main pane from repainting. The app now marshals overlay publication to its UI thread; the test awaits the actual PanelsChanged notification while keeping its F4 and empty-panel assertions. No sleeps, skipped tests, or framework changes. An isolated blocked-thread-pool probe reproduced the original ordering; the corrected focused test passed eight independent repetitions.
  • New protocol integration cases pass, including fragmented/no-newline queries, control-string shielding and prompt recovery. Focused Avalonia geometry checks pass 8/8, including pointer-absent hosting and handshake/DPI changes.
  • Real disposable Linux PTY checks confirm 120x40 cells with 1200x960 pixels reports 10x24; unknown/inexact/redirected cases remain unknown. macOS ABI was reviewed, not executed on macOS.

Status

Draft for review. The earlier unreleased-dependency limitation is resolved by the published TNC 4.9.0 pin; normal package-backed build now passes. No merge, release or deployment performed.

@coderabbitai

coderabbitai Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@HarryCordewener
HarryCordewener marked this pull request as ready for review November 9, 2026 04:51
@HarryCordewener
HarryCordewener merged commit bd29bfe into main Nov 9, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant