Skip to content

Reference ​

tsx
import { TerminalView, type TerminalViewHandle } from '@adecore/terminal';

Props ​

The props are TerminalViewProps.

PropType
onData(data: string) => voidWhat the person types or pastes.
onResize(cols: number, rows: number) => voidA new grid after a resize or a font change.
onOpenLink(uri: string, event: MouseEvent) => voidWhere a web link goes. A new window by default.
onLinkHover(uri: string | null, bounds: TerminalLinkBounds | null) => voidThe target under the pointer, or null on leave.
fontSizenumber13 by default.
lineHeightnumber1 by default.
readOnlybooleanShows output only.
convertEolbooleanA lone line feed is a line break.
webglbooleanDraws with WebGL while the budget has room.
scaledByAncestorbooleanAn ancestor scales the terminal. Read at mount.
labelstringNames the terminal as a region.
classNamestringThe terminal has no size of its own; this gives it one.
refRef<TerminalViewHandle>The handle.

Handle ​

The handle is a TerminalViewHandle.

Member
terminalThe xterm instance, or null before mount.
write(data, done?)Draws output; done runs once it is drawn.
reset()Clears the screen and the scrollback.
focus(), blur()Moves the keyboard, and ranks the terminal for WebGL.
paste(text)Pastes, bracketed when the program asks for that.
selectAll(), selection()The selection, empty without one.
size()The grid as a TerminalSize, { cols, rows }.
visibleText()The rows on screen as text.
followGrid(size)Draws the grid another client set.

Exports ​

Every name @adecore/terminal exports, read from its source. Anything not listed is internal. @adecore/terminal/terminal.css holds the styles.

NameKindSource
TerminalViewcomponentTerminalView
TerminalSizetypeTerminalView
TerminalViewHandletypeTerminalView
TerminalViewPropstypeTerminalView
webglTerminalsfunctionwebgl-budget
linkLineBoundsfunctionlinks
TerminalLinkBoundstypelinks

Licenses and third-party notices are listed in each package.