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

Function getViewportLineContent

lib/terminal.test.ts:1665–1675  ·  view source on GitHub ↗

* Helper to get line content directly from viewport

(term: Terminal, y: number)

Source from the content-addressed store, hash-verified

1663 * Helper to get line content directly from viewport
1664 */
1665 function getViewportLineContent(term: Terminal, y: number): string {
1666 const viewport = term.wasmTerm?.getViewport();
1667 if (!viewport) return '';
1668 const cols = term.cols;
1669 const start = y * cols;
1670 return viewport
1671 .slice(start, start + cols)
1672 .map((c) => String.fromCodePoint(c.codepoint || 32))
1673 .join('')
1674 .trimEnd();
1675 }
1676
1677 test('BUG REPRO: getLine and getViewport should return same data after partial updates', async () => {
1678 const term = await createIsolatedTerminal({ cols: 80, rows: 24 });

Callers 1

terminal.test.tsFile · 0.85

Calls 1

getViewportMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…