Skip to content

terminal/ghostty

import { … } from 'zidane-ui/terminal'ui/src/terminal/ghostty.ts

Functions#

loadGhosttyFunction#

The initialised library. A failed load is forgotten, so the next view retries.

TypeScript
function loadGhostty(symbolsFontUrl?: string): Promise<__module>
Parameters
NameTypeDescription
symbolsFontUrl?string

Where the app serves the SYMBOLS_FONT face, loaded before the first terminal so the canvas has it on paint. Without it those glyphs draw as boxes.

Promise<__module>

ui/src/terminal/ghostty.ts:106

openTerminalFunction#

term.open(mount) without its focus grab: ghostty-web's open calls focus(), which focuses the terminal now and again on a timer, so one mounting in the background (the drawer of a conversation a space switch reopened) took focus from wherever the user was. focus is a no-op while open runs; the surfaces focus the terminal themselves when asked to (autoFocus).

TypeScript
function openTerminal(
  term: { focus(): void; open(parent: HTMLElement): void },
  mount: HTMLElement,
): void
Parameters
NameTypeDescription
term{ focus(): void; open(parent: HTMLElement): void }

The terminal to open.

mountHTMLElement

The element it renders into.

ui/src/terminal/ghostty.ts:69

Constants#

SYMBOLS_FONTConstant#

Nerd Font symbols (powerline arrows, the git branch glyph prompts print, file icons): the family the app puts last in its terminal font stack, so a Nerd Font the user has installed still wins.

TypeScript
const SYMBOLS_FONT = 'Symbols Nerd Font Mono'

ui/src/terminal/ghostty.ts:88