Make SevenTTY usable with Claude Code and other modern TUIs#1
Open
ctar wants to merge 3 commits into
Open
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
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 inansi_sys_fixup(net.c + telnet.c) to keep the byte stream clean.ansi_fixup_statestate machine extended with states 3–7 to match the 8-byte sequence across SSH read boundaries.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 bothdraw_screen_coloranddraw_screen_fastBEFOREsymbol_font_lookupand 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.Rename icons.r to app_icons.r (case-insensitive FS collision) — On macOS's case-insensitive APFS, SevenTTY's
icons.rresolves to the same path as Apple'sIcons.rfrom 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 toapp_icons.rand updateresources.r. Doesn't affect Linux builds but is required for cross-compilation on macOS.Test plan
claude(Claude Code CLI) over SSH: typed input visible, welcome banner borders visible, input box borders visible,❯prompt visiblehtopover SSH: dim USER/CPU% columns now visible as ASCII fallbacks🤖 Generated with Claude Code