TerminalSession
Type Parameters
Section titled “Type Parameters”TEvent
Section titled “TEvent”TEvent = unknown
Accessors
Section titled “Accessors”alternateScreen
Section titled “alternateScreen”Get Signature
Section titled “Get Signature”get alternateScreen():
boolean
Returns
Section titled “Returns”boolean
appearance
Section titled “appearance”Get Signature
Section titled “Get Signature”get appearance():
TerminalAppearance
Returns
Section titled “Returns”cursor
Section titled “cursor”Get Signature
Section titled “Get Signature”get cursor():
TerminalCursorSnapshot
Returns
Section titled “Returns”focused
Section titled “focused”Get Signature
Section titled “Get Signature”get focused():
boolean
Returns
Section titled “Returns”boolean
focusReportingEnabled
Section titled “focusReportingEnabled”Get Signature
Section titled “Get Signature”get focusReportingEnabled():
boolean
Returns
Section titled “Returns”boolean
Get Signature
Section titled “Get Signature”get grid():
TerminalGrid
Returns
Section titled “Returns”mouseTracking
Section titled “mouseTracking”Get Signature
Section titled “Get Signature”get mouseTracking():
boolean
Returns
Section titled “Returns”boolean
renderState
Section titled “renderState”Get Signature
Section titled “Get Signature”get renderState():
RenderStateSource
Returns
Section titled “Returns”revision
Section titled “revision”Get Signature
Section titled “Get Signature”get revision():
number
Returns
Section titled “Returns”number
runtime
Section titled “runtime”Get Signature
Section titled “Get Signature”get runtime():
GhosttyRuntime
Returns
Section titled “Returns”scrollbackLength
Section titled “scrollbackLength”Get Signature
Section titled “Get Signature”get scrollbackLength():
number
Returns
Section titled “Returns”number
scrollbar
Section titled “scrollbar”Get Signature
Section titled “Get Signature”get scrollbar():
Readonly<TerminalScrollbar>
Returns
Section titled “Returns”Readonly<TerminalScrollbar>
viewportActive
Section titled “viewportActive”Get Signature
Section titled “Get Signature”get viewportActive():
boolean
Returns
Section titled “Returns”boolean
Methods
Section titled “Methods”activateLink()
Section titled “activateLink()”activateLink(
resolution,event):Promise<boolean>
Parameters
Section titled “Parameters”resolution
Section titled “resolution”LinkResolution<TEvent>
TEvent
Returns
Section titled “Returns”Promise<boolean>
cancelSelection()
Section titled “cancelSelection()”cancelSelection():
boolean
Returns
Section titled “Returns”boolean
clear()
Section titled “clear()”clear():
TerminalMutationResult
Returns
Section titled “Returns”clearSelection()
Section titled “clearSelection()”clearSelection():
boolean
Returns
Section titled “Returns”boolean
dispose()
Section titled “dispose()”dispose():
void
Returns
Section titled “Returns”void
geometry()
Section titled “geometry()”geometry():
TerminalGeometry
Returns
Section titled “Returns”getSelection()
Section titled “getSelection()”getSelection(
options?):string|undefined
Parameters
Section titled “Parameters”options?
Section titled “options?”TerminalSelectionFormatOptions
Returns
Section titled “Returns”string | undefined
isLinkCurrent()
Section titled “isLinkCurrent()”isLinkCurrent(
resolution):boolean
Parameters
Section titled “Parameters”resolution
Section titled “resolution”LinkResolution<TEvent>
Returns
Section titled “Returns”boolean
isPasteSafe()
Section titled “isPasteSafe()”isPasteSafe(
data):boolean
Parameters
Section titled “Parameters”Returns
Section titled “Returns”boolean
key(
input,options?):TerminalInputResult
Parameters
Section titled “Parameters”options?
Section titled “options?”TerminalSessionKeyOptions
Returns
Section titled “Returns”lineCount()
Section titled “lineCount()”lineCount():
number
Returns
Section titled “Returns”number
measure()
Section titled “measure()”measure(
text):number
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”number
measureTexts()
Section titled “measureTexts()”measureTexts(
texts):TerminalTextMeasurement
Plain printing text only; VT controls go through writeAndReadGeometry.
Parameters
Section titled “Parameters”readonly string[]
Returns
Section titled “Returns”mouse()
Section titled “mouse()”mouse(
input):TerminalInputResult
Parameters
Section titled “Parameters”Returns
Section titled “Returns”on<
TType>(type,listener):TerminalSessionSubscription
Type Parameters
Section titled “Type Parameters”TType extends keyof TerminalSessionEventMap
Parameters
Section titled “Parameters”TType
listener
Section titled “listener”TerminalSessionListener<TType>
Returns
Section titled “Returns”paste()
Section titled “paste()”paste(
data,options?):TerminalInputResult
Parameters
Section titled “Parameters”options?
Section titled “options?”TerminalSessionPasteOptions
Returns
Section titled “Returns”readLines()
Section titled “readLines()”readLines(
start,end,options?): readonlyTerminalLine[]
Parameters
Section titled “Parameters”number
number
options?
Section titled “options?”Returns
Section titled “Returns”readonly TerminalLine[]
registerLinkProvider()
Section titled “registerLinkProvider()”registerLinkProvider(
provider):LinkProviderRegistration
Parameters
Section titled “Parameters”provider
Section titled “provider”LinkProvider<TEvent>
Returns
Section titled “Returns”reportFocus()
Section titled “reportFocus()”reportFocus():
TerminalInputResult
Returns
Section titled “Returns”reset()
Section titled “reset()”reset():
TerminalMutationResult
Returns
Section titled “Returns”resetMouseTracking()
Section titled “resetMouseTracking()”resetMouseTracking():
void
Returns
Section titled “Returns”void
resetSelectionGesture()
Section titled “resetSelectionGesture()”resetSelectionGesture():
void
Returns
Section titled “Returns”void
resize()
Section titled “resize()”resize(
grid):TerminalMutationResult
Parameters
Section titled “Parameters”Partial<TerminalGrid>
Returns
Section titled “Returns”resolveLink()
Section titled “resolveLink()”resolveLink(
request,isRequestCurrent?):Promise<LinkResolution<TEvent>>
Parameters
Section titled “Parameters”request
Section titled “request”isRequestCurrent?
Section titled “isRequestCurrent?”() => boolean
Returns
Section titled “Returns”Promise<LinkResolution<TEvent>>
resolveLinkDiscovery()
Section titled “resolveLinkDiscovery()”resolveLinkDiscovery(
request,getProjection):NativeLinkDiscoverySnapshot|undefined
Parameters
Section titled “Parameters”request
Section titled “request”NativeLinkDiscoveryRequest
getProjection
Section titled “getProjection”() => LinkProjection | undefined
Returns
Section titled “Returns”NativeLinkDiscoverySnapshot | undefined
resolveLinkSnapshot()
Section titled “resolveLinkSnapshot()”resolveLinkSnapshot(
request,getProjection):NativeLinkSnapshot|undefined
Parameters
Section titled “Parameters”request
Section titled “request”NativeLinkRequest
getProjection
Section titled “getProjection”() => LinkProjection | undefined
Returns
Section titled “Returns”NativeLinkSnapshot | undefined
scrollBy()
Section titled “scrollBy()”scrollBy(
delta):TerminalMutationResult
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”scrollToBottom()
Section titled “scrollToBottom()”scrollToBottom():
TerminalMutationResult
Returns
Section titled “Returns”scrollToRow()
Section titled “scrollToRow()”scrollToRow(
row):TerminalMutationResult
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”scrollToTop()
Section titled “scrollToTop()”scrollToTop():
TerminalMutationResult
Returns
Section titled “Returns”selectAll()
Section titled “selectAll()”selectAll():
SelectionGestureUpdate
Returns
Section titled “Returns”selectionAutoscrollTick()
Section titled “selectionAutoscrollTick()”selectionAutoscrollTick(
input):SelectionGestureUpdate
Parameters
Section titled “Parameters”Returns
Section titled “Returns”selectionCoordinates()
Section titled “selectionCoordinates()”selectionCoordinates():
SelectionCoordinates|undefined
Returns
Section titled “Returns”SelectionCoordinates | undefined
selectionDrag()
Section titled “selectionDrag()”selectionDrag(
input):SelectionGestureUpdate
Parameters
Section titled “Parameters”Returns
Section titled “Returns”selectionPress()
Section titled “selectionPress()”selectionPress(
input):SelectionGestureUpdate
Parameters
Section titled “Parameters”Returns
Section titled “Returns”selectionRelease()
Section titled “selectionRelease()”selectionRelease(
input?):SelectionGestureRelease
Parameters
Section titled “Parameters”input?
Section titled “input?”Readonly<SelectionPoint>
Returns
Section titled “Returns”selectLines()
Section titled “selectLines()”selectLines(
startRow,endRow):SelectionGestureUpdate
Parameters
Section titled “Parameters”startRow
Section titled “startRow”number
endRow
Section titled “endRow”number
Returns
Section titled “Returns”selectRange()
Section titled “selectRange()”selectRange(
start,end):SelectionGestureUpdate
Parameters
Section titled “Parameters”Returns
Section titled “Returns”sendInput()
Section titled “sendInput()”sendInput(
data,options?):TerminalInputResult
Parameters
Section titled “Parameters”options?
Section titled “options?”TerminalSessionSendInputOptions
Returns
Section titled “Returns”setAppearance()
Section titled “setAppearance()”setAppearance(
options):TerminalMutationResult
Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”setClipboardWritePolicy()
Section titled “setClipboardWritePolicy()”setClipboardWritePolicy(
policy?):void
Parameters
Section titled “Parameters”policy?
Section titled “policy?”Returns
Section titled “Returns”void
setColorScheme()
Section titled “setColorScheme()”setColorScheme(
colorScheme):TerminalMutationResult
Parameters
Section titled “Parameters”colorScheme
Section titled “colorScheme”Returns
Section titled “Returns”setCursor()
Section titled “setCursor()”setCursor(
cursor):TerminalMutationResult
Parameters
Section titled “Parameters”cursor
Section titled “cursor”Partial<TerminalCursorSettings>
Returns
Section titled “Returns”setFocused()
Section titled “setFocused()”setFocused(
focused):TerminalInputResult
Parameters
Section titled “Parameters”focused
Section titled “focused”boolean
Returns
Section titled “Returns”setFont()
Section titled “setFont()”setFont(
font):TerminalMutationResult
Parameters
Section titled “Parameters”Partial<TerminalFontSettings>
Returns
Section titled “Returns”setScrollbackByteLimit()
Section titled “setScrollbackByteLimit()”setScrollbackByteLimit(
scrollbackByteLimit?):TerminalMutationResult
Undefined removes the byte budget. Zero erases history and disables further scrollback.
Parameters
Section titled “Parameters”scrollbackByteLimit?
Section titled “scrollbackByteLimit?”number
Returns
Section titled “Returns”setScrollbackLimit()
Section titled “setScrollbackLimit()”setScrollbackLimit(
scrollbackLimit?):TerminalMutationResult
Sets the native page-granular row budget. Read scrollbackLength for actual retention.
Parameters
Section titled “Parameters”scrollbackLimit?
Section titled “scrollbackLimit?”number
Returns
Section titled “Returns”setSelectionWordBoundaryCodepoints()
Section titled “setSelectionWordBoundaryCodepoints()”setSelectionWordBoundaryCodepoints(
value):boolean
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”boolean
setTheme()
Section titled “setTheme()”setTheme(
theme):TerminalMutationResult
Parameters
Section titled “Parameters”Returns
Section titled “Returns”subscribeCustomOsc()
Section titled “subscribeCustomOsc()”subscribeCustomOsc(
number):TerminalCustomOscSubscription
Parameters
Section titled “Parameters”number
Section titled “number”number
Returns
Section titled “Returns”TerminalCustomOscSubscription
write()
Section titled “write()”write(
data):TerminalMutationResult
Parameters
Section titled “Parameters”Returns
Section titled “Returns”writeAndReadGeometry()
Section titled “writeAndReadGeometry()”writeAndReadGeometry(
data):TerminalGeometry
Parameters
Section titled “Parameters”Returns
Section titled “Returns”writeln()
Section titled “writeln()”writeln(
data):TerminalMutationResult
Parameters
Section titled “Parameters”Returns
Section titled “Returns”create()
Section titled “create()”
staticcreate<TEvent>(options?):Promise<TerminalSession<TEvent>>
Type Parameters
Section titled “Type Parameters”TEvent
Section titled “TEvent”TEvent = unknown
Parameters
Section titled “Parameters”options?
Section titled “options?”TerminalSessionOptions<TEvent>
Returns
Section titled “Returns”Promise<TerminalSession<TEvent>>