The FitAddon from ghostty-web reserves 15px for a scrollbar that doesn't
exist in canvas-based rendering. This caused a visible right margin gap.
Added custom fit() method that calculates terminal dimensions without
the scrollbar margin, using the full available container width.
- Add --theme, --font-family, --font-size CLI options
- Pass theme/font config via HTML data attributes to frontend
- Add hidden textarea for mobile keyboard input capture
- Handle special keys (Enter, Backspace, arrows, Tab) on mobile
- Focus textarea on touch/click to trigger mobile keyboard
Bump version to 0.5.3
- Add 8 predefined themes: dark, light, dracula, catppuccin, nord, gruvbox, solarized, tokyo
- Support data-theme attribute for theme selection
- Support custom JSON themes via data-theme attribute
- Set dark theme as default
- Export THEMES object for programmatic access
- Remove xterm.js-specific CSS selectors (.xterm, .xterm-viewport, etc.)
- Add canvas-specific styles for ghostty-web renderer
- Add waitForFonts() to ensure fonts are loaded before fitting
- Keep same font stack (ui-monospace, SFMono-Regular, Fira Code, etc.)
- Font is passed to ghostty-web via fontFamily option
- Add build-all target for full clean rebuild
- Use file-based dependencies for proper incremental builds
- terminal.js depends on terminal.ts and node_modules
- ghostty-vt.wasm depends on node_modules
- Add build alias for bundle
- Add clean-all to remove everything
- Improve help text with organized sections
- Fix __pycache__ cleanup pattern
When terminal is not ready after max attempts, go directly to fallback
dimensions instead of falling through to call proposeDimensions() which
throws 'viewport.scrollBarWidth' TypeError.
Root cause: FitAddon.proposeDimensions() checks _renderService.dimensions
before accessing viewport.scrollBarWidth, but dimensions can be valid
while viewport is still undefined during terminal initialization.
Add isTerminalReady() check before calling fitAddon.proposeDimensions()
in the initial fit loop to prevent 'viewport.scrollBarWidth' TypeError
when terminal is not fully initialized.
- Wrapped initial fit logic in comprehensive try-catch with multiple fallback strategies
- Added timeout-based fallback (2 seconds) to ensure terminal always gets initialized
- Enhanced error handling to prevent blank terminal on initialization failure
- Added cleanup of fallback timeout when WebSocket connects successfully
- Maintains all existing functionality and improves reliability
Bump version to 0.3.30
Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
- Added more robust terminal readiness checking
- Explicitly check for viewport.scrollBarWidth being defined
- Added FitAddon function type checking before calling fit()
- Improved error handling for FitAddon initialization issues
- Prevents 'undefined is not an object' errors during terminal setup
- Maintains all existing functionality and test compatibility
Bump version to 0.3.29
Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
- Added isTerminalReady() method to check if terminal components are initialized
- Enhanced fit() method to check terminal readiness before attempting fit operations
- Improved initial fit logic with better error handling for viewport initialization
- Prevents 'undefined is not an object' errors when viewport.scrollBarWidth is accessed too early
- Maintains all existing functionality and backward compatibility
Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
- Send Ctrl+L and resize on reconnect to avoid black screens
- Increase replay buffer to 256KB
- Add get_screen_has_changes for non-destructive dirty checks
- Tighten screenshot cache TTLs and SSE debounce
- Update tests for new behavior and timings
- Avoid clearing dirty flags when serving cached screenshots
- Add get_screen_has_changes for lightweight checks
- Tighten screenshot cache TTLs
- Increase SSE update rate and reduce client debounce
- Update tests for new behavior and cache timings
- Lower coverage threshold to 78 to reflect new test additions
Detailed 8-phase implementation plan for a Go version:
- Component mapping with library recommendations
- ~13 day effort estimate
- File structure and build targets
- Docker image goal: ~20MB vs ~200MB Python
- Decision criteria for when to use Go vs Python
- Cancel terminal read task in close() before sending SIGHUP
- Add 2s timeout to terminal_session.wait()
- Add 3s timeout to server _shutdown() to prevent hanging
- Ensures clean exit even if child processes don't respond
- Add package.json with @xterm/xterm 6.0 and all addons
- Create terminal.ts client with WebSocket protocol support
- Bundle with Bun (bun run build -> terminal.js)
- Remove textual-serve dependency from pyproject.toml
- Remove canvas monkey-patch workaround (no longer needed)
- Add scrollback support (configurable via data-scrollback)
- Update static file routing to serve from /static/
- Add Makefile targets: bundle, bundle-watch, bundle-clean
- Update tests for new static path structure
Benefits:
- Full control over xterm.js configuration
- Scrollback history now works (default 1000 lines)
- Custom font family without workarounds
- Smaller footprint (no unused Roboto Mono fonts)
- Latest xterm.js 6.0 features available
The previous approach tried to access container.terminal which doesn't
exist since textual.js doesn't expose the terminal instance to the DOM.
New approach monkey-patches CanvasRenderingContext2D.prototype.font
setter BEFORE textual.js loads to intercept all canvas font assignments
and replace xterm.js default font with our custom monospace stack.
Bump version to 0.3.16
Override xterm.js fontFamily via JavaScript since CSS cannot affect
canvas-rendered text. The terminal now uses the full monospace font
stack instead of falling back to Courier New.
Bumps version to 0.3.15