Skip to content

Make SevenTTY usable with Claude Code and other modern TUIs#1

Open
ctar wants to merge 3 commits into
LXXero:masterfrom
ctar:claude-code-fixes
Open

Make SevenTTY usable with Claude Code and other modern TUIs#1
ctar wants to merge 3 commits into
LXXero:masterfrom
ctar:claude-code-fixes

Conversation

@ctar
Copy link
Copy Markdown

@ctar ctar commented Apr 11, 2026

Summary

Three small fixes that together make SevenTTY work with Claude Code (the Anthropic CLI, an Ink-based TUI) and similar modern terminal apps that rely heavily on Unicode box-drawing and dingbats. Also fixes building SevenTTY on macOS (case-insensitive APFS).

Commits

  1. Strip DECSET 2026 synchronized-output markers in SSH/telnet — Claude Code wraps every typed character draw in ESC[?2026l...ESC[?2026h. libvterm doesn't implement synchronized output, so these become unknown DEC private modes. Stripped defensively in ansi_sys_fixup (net.c + telnet.c) to keep the byte stream clean. ansi_fixup_state state machine extended with states 3–7 to match the 8-byte sequence across SSH read boundaries.

  2. Fall back to ASCII for Unicode box-drawing, blocks, and TUI dingbats — The symbol-font rendering path produces blank glyphs for codepoints in U+2500–U+259F and common dingbats like (U+276F), so anything drawn through it was invisible. This made Claude Code's input box borders, welcome banner borders, and prompt character completely invisible. Intercept these codepoints in both draw_screen_color and draw_screen_fast BEFORE symbol_font_lookup and remap them to ASCII equivalents (-, |, corners/joints→+, diagonals→/ \ X, blocks→# ., half-blocks→" _, >, arrows→<>^v, bullets→*, checks→v x). Renders via Monaco and preserves column alignment. This is a workaround rather than a root-cause fix for the symbol-font issue itself — not sure why the custom NFNT produces blank glyphs on my build — but it reliably unblocks Claude Code, htop's dim bars, and other modern TUIs.

  3. Rename icons.r to app_icons.r (case-insensitive FS collision) — On macOS's case-insensitive APFS, SevenTTY's icons.r resolves to the same path as Apple's Icons.r from the MPW RIncludes, so #include "Icons.r" inside SevenTTY's own icons.r recurses into itself and hits Rez's "include files nested too deep" limit. Rename to app_icons.r and update resources.r. Doesn't affect Linux builds but is required for cross-compilation on macOS.

Test plan

  • Build PPC target on macOS 14.8 (Apple Silicon) with Retro68 + MPW 3.5 Universal Interfaces
  • Tested on a real PowerPC G3 All-in-One running OS 9
  • claude (Claude Code CLI) over SSH: typed input visible, welcome banner borders visible, input box borders visible, prompt visible
  • htop over SSH: dim USER/CPU% columns now visible as ASCII fallbacks
  • Smoke test: normal SSH sessions, local shell, theme loading, scrollback all still work

🤖 Generated with Claude Code

ctar and others added 3 commits April 11, 2026 16:28
Claude Code wraps every typed character draw in `ESC[?2026l` ...
`ESC[?2026h` (DECSET 2026, synchronized update). libvterm doesn't
implement synchronized output, so these are handled as unknown DEC
private modes. Strip them in `ansi_sys_fixup` to keep the stream
clean and avoid relying on libvterm's "unknown mode" tolerance.

Extend the `ansi_fixup_state` state machine with states 3-7 so the
8-byte `ESC[?2026X` sequence matches correctly even when split
across SSH read boundaries.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The symbol-font rendering path produces blank glyphs for codepoints
in U+2500-U+259F (box drawing, block elements) and common TUI
dingbats like `❯` (U+276F), so anything drawn through it was
invisible. This made Claude Code's input box borders, welcome
banner borders, and prompt character completely invisible.

Intercept these codepoints in both `draw_screen_color` and
`draw_screen_fast` BEFORE the `symbol_font_lookup` call and remap
them to ASCII equivalents:
  ─  -> -        █ ▉ ▊ ▋ ▌ ▍ ▎ ▏ ▐ ▓ -> #
  │  -> |        ░ ▒ -> .
  ┌┐└┘├┤┬┴┼ -> + ▀ -> "
  ╭╮╰╯ -> +      ▄ -> _
  ╔╗╚╝╠╣╦╩╬ -> + ❯ -> >
  ═  -> -        ← → ↑ ↓ -> < > ^ v
  ║  -> |        ● ○ ⬤ -> *
  ╱╲╳ -> / \ X    ✓ -> v   ✗ ✕ -> x

Renders via Monaco (known working). Preserves column alignment.
Not a root-cause fix for the symbol-font rendering itself, but a
reliable workaround that unblocks Claude Code, htop's dim bars,
and other modern TUIs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
On macOS's case-insensitive APFS, SevenTTY's `icons.r` file
resolves to the same path as Apple's `Icons.r` from the MPW
RIncludes, so `#include "Icons.r"` inside SevenTTY's own icons.r
recurses into itself and hits Rez's "include files nested too
deep" limit.

Rename to `app_icons.r` and update the `#include` in resources.r
accordingly. Doesn't affect Linux builds but is required for
cross-compilation on macOS.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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