MCPcopy Create free account
hub / github.com/coder/ghostty-web / withTerminals

Function withTerminals

bench/versus.ts:52–70  ·  view source on GitHub ↗
(fn: (term: GhosttyTerminal | XTerm) => Promise<void>)

Source from the content-addressed store, hash-verified

50}
51
52const withTerminals = async (fn: (term: GhosttyTerminal | XTerm) => Promise<void>) => {
53 const ghostty = await Ghostty.load();
54 bench('ghostty-web', async () => {
55 const container = document.createElement('div');
56 document.body.appendChild(container);
57 const term = new GhosttyTerminal({ ghostty });
58 await term.open(container);
59 await fn(term);
60 await term.dispose();
61 });
62 bench('xterm.js', async () => {
63 const xterm = new XTerm();
64 const container = document.createElement('div');
65 document.body.appendChild(container);
66 await xterm.open(container);
67 await fn(xterm);
68 await xterm.dispose();
69 });
70};
71
72const throughput = async (prefix: string, data: Record<string, Uint8Array | string>) => {
73 await Promise.all(

Callers 2

throughputFunction · 0.85
versus.tsFile · 0.85

Calls 3

loadMethod · 0.80
openMethod · 0.80
disposeMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…