Skip to content

Render ANSI terminal output with bundled Hack Nerd Font - #12

Open
AsafMah wants to merge 1 commit into
dcolinmorgan:mainfrom
AsafMah:contrib/ansi-terminal
Open

Render ANSI terminal output with bundled Hack Nerd Font#12
AsafMah wants to merge 1 commit into
dcolinmorgan:mainfrom
AsafMah:contrib/ansi-terminal

Conversation

@AsafMah

@AsafMah AsafMah commented Jul 20, 2026

Copy link
Copy Markdown

Summary

  • add opt-in ANSI pane reads while keeping text as the protocol default
  • opt the web terminal into ANSI output
  • safely translate SGR styling into DOM text spans
  • support standard, bright, 256-color, and true-color output
  • support emphasis, underline variants, inverse video, and conceal
  • consume unsupported controls rather than displaying escape suffixes
  • preserve fixed-width layouts with horizontal scrolling
  • bundle Hack Nerd Font as WOFF2 with its distributed Hack license notice
  • serve font/license assets with explicit content types and revalidating caching

Motivation

The remote terminal currently loses colors, renders Nerd Font symbols inconsistently, and wraps terminal cell layouts as prose.

Security and compatibility

  • terminal output is inserted only as text-bearing DOM nodes
  • no pane output is assigned to innerHTML
  • ANSI transport is explicit, so Telegram and older clients retain text
  • static assets can load alongside token-authenticated pages
  • no third-party CDN is required

Verification

  • tests/run.sh: 18 passed, 0 failed
  • focused ANSI transport test passed
  • default reads remain text; web requests ANSI
  • conceal, colon-form underline, inverse-video, and color cases exercised
  • Hack Nerd Font loaded via document.fonts.check
  • 375px viewport retained a 375px document width
  • branch is one clean commit over main

@AsafMah
AsafMah force-pushed the contrib/ansi-terminal branch from 5f14288 to b864606 Compare July 20, 2026 06:50
@AsafMah
AsafMah force-pushed the contrib/ansi-terminal branch from b864606 to b298db6 Compare August 5, 2026 06:00
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.

1 participant