GhosttyTerminal
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new GhosttyTerminal(
runtime,options):GhosttyTerminal
Parameters
Section titled “Parameters”runtime
Section titled “runtime”options
Section titled “options”Returns
Section titled “Returns”GhosttyTerminal
Properties
Section titled “Properties”runtime
Section titled “runtime”
readonlyruntime:GhosttyRuntime
Accessors
Section titled “Accessors”activeScreen
Section titled “activeScreen”Get Signature
Section titled “Get Signature”get activeScreen():
TerminalScreen
Returns
Section titled “Returns”TerminalScreen
backgroundColor
Section titled “backgroundColor”Get Signature
Section titled “Get Signature”get backgroundColor():
RgbColor|undefined
Returns
Section titled “Returns”RgbColor | undefined
colors
Section titled “colors”Get Signature
Section titled “Get Signature”get colors():
TerminalColors
Returns
Section titled “Returns”cursor
Section titled “cursor”Get Signature
Section titled “Get Signature”get cursor():
TerminalCursor
Returns
Section titled “Returns”cursorColor
Section titled “cursorColor”Get Signature
Section titled “Get Signature”get cursorColor():
RgbColor|undefined
Returns
Section titled “Returns”RgbColor | undefined
defaultBackgroundColor
Section titled “defaultBackgroundColor”Get Signature
Section titled “Get Signature”get defaultBackgroundColor():
RgbColor|undefined
Returns
Section titled “Returns”RgbColor | undefined
defaultColors
Section titled “defaultColors”Get Signature
Section titled “Get Signature”get defaultColors():
TerminalColors
Returns
Section titled “Returns”defaultCursorBlink
Section titled “defaultCursorBlink”Get Signature
Section titled “Get Signature”get defaultCursorBlink():
boolean
Returns
Section titled “Returns”boolean
defaultCursorColor
Section titled “defaultCursorColor”Get Signature
Section titled “Get Signature”get defaultCursorColor():
RgbColor|undefined
Returns
Section titled “Returns”RgbColor | undefined
defaultCursorStyle
Section titled “defaultCursorStyle”Get Signature
Section titled “Get Signature”get defaultCursorStyle():
TerminalCursorStyle
Returns
Section titled “Returns”defaultForegroundColor
Section titled “defaultForegroundColor”Get Signature
Section titled “Get Signature”get defaultForegroundColor():
RgbColor|undefined
Returns
Section titled “Returns”RgbColor | undefined
defaultPalette
Section titled “defaultPalette”Get Signature
Section titled “Get Signature”get defaultPalette(): readonly
RgbColor[]
Returns
Section titled “Returns”readonly RgbColor[]
foregroundColor
Section titled “foregroundColor”Get Signature
Section titled “Get Signature”get foregroundColor():
RgbColor|undefined
Returns
Section titled “Returns”RgbColor | undefined
handle
Section titled “handle”Get Signature
Section titled “Get Signature”get handle():
number
Returns
Section titled “Returns”number
hasSelection
Section titled “hasSelection”Get Signature
Section titled “Get Signature”get hasSelection():
boolean
Returns
Section titled “Returns”boolean
kittyKeyboardFlags
Section titled “kittyKeyboardFlags”Get Signature
Section titled “Get Signature”get kittyKeyboardFlags():
number
Returns
Section titled “Returns”number
mouseTracking
Section titled “mouseTracking”Get Signature
Section titled “Get Signature”get mouseTracking():
boolean
Returns
Section titled “Returns”boolean
palette
Section titled “palette”Get Signature
Section titled “Get Signature”get palette(): readonly
RgbColor[]
Returns
Section titled “Returns”readonly RgbColor[]
scrollbackByteLimit
Section titled “scrollbackByteLimit”Get Signature
Section titled “Get Signature”get scrollbackByteLimit():
number|undefined
Configured page-granular byte budget. Undefined means unlimited; zero disables history.
Returns
Section titled “Returns”number | undefined
scrollbackLength
Section titled “scrollbackLength”Get Signature
Section titled “Get Signature”get scrollbackLength():
number
Actual retained physical rows, excluding the active screen.
Returns
Section titled “Returns”number
scrollbackLimit
Section titled “scrollbackLimit”Get Signature
Section titled “Get Signature”get scrollbackLimit():
number|undefined
Configured page-granular line budget. Read scrollbackLength for the retained count.
Returns
Section titled “Returns”number | undefined
scrollbar
Section titled “scrollbar”Get Signature
Section titled “Get Signature”get scrollbar():
TerminalScrollbar
Returns
Section titled “Returns”Get Signature
Section titled “Get Signature”get size():
TerminalSize
Returns
Section titled “Returns”Get Signature
Section titled “Get Signature”get title():
string
Returns
Section titled “Returns”string
totalRows
Section titled “totalRows”Get Signature
Section titled “Get Signature”get totalRows():
number
Returns
Section titled “Returns”number
viewportActive
Section titled “viewportActive”Get Signature
Section titled “Get Signature”get viewportActive():
boolean
Returns
Section titled “Returns”boolean
Methods
Section titled “Methods”clear()
Section titled “clear()”clear():
void
Returns
Section titled “Returns”void
clearSelection()
Section titled “clearSelection()”clearSelection():
void
Returns
Section titled “Returns”void
dispose()
Section titled “dispose()”dispose():
void
Returns
Section titled “Returns”void
getSelection()
Section titled “getSelection()”getSelection(
options?):string|undefined
Parameters
Section titled “Parameters”options?
Section titled “options?”TerminalSelectionFormatOptions
Returns
Section titled “Returns”string | undefined
isModeEnabled()
Section titled “isModeEnabled()”isModeEnabled(
mode):boolean
Parameters
Section titled “Parameters”TerminalMode
Returns
Section titled “Returns”boolean
lineCount()
Section titled “lineCount()”lineCount():
number
Returns
Section titled “Returns”number
linkAt()
Section titled “linkAt()”linkAt(
point):string|undefined
Parameters
Section titled “Parameters”Returns
Section titled “Returns”string | undefined
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[]
reset()
Section titled “reset()”reset():
void
Returns
Section titled “Returns”void
resize()
Section titled “resize()”resize(
size):void
Parameters
Section titled “Parameters”Partial<TerminalSize>
Returns
Section titled “Returns”void
scrollBy()
Section titled “scrollBy()”scrollBy(
delta):void
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”void
scrollToBottom()
Section titled “scrollToBottom()”scrollToBottom():
void
Returns
Section titled “Returns”void
scrollToRow()
Section titled “scrollToRow()”scrollToRow(
row):void
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”void
scrollToTop()
Section titled “scrollToTop()”scrollToTop():
void
Returns
Section titled “Returns”void
selectAll()
Section titled “selectAll()”selectAll():
boolean
Returns
Section titled “Returns”boolean
setDefaultBackgroundColor()
Section titled “setDefaultBackgroundColor()”setDefaultBackgroundColor(
color?):void
Parameters
Section titled “Parameters”color?
Section titled “color?”Returns
Section titled “Returns”void
setDefaultCursorBlink()
Section titled “setDefaultCursorBlink()”setDefaultCursorBlink(
blink?):void
Parameters
Section titled “Parameters”blink?
Section titled “blink?”boolean
Returns
Section titled “Returns”void
setDefaultCursorColor()
Section titled “setDefaultCursorColor()”setDefaultCursorColor(
color?):void
Parameters
Section titled “Parameters”color?
Section titled “color?”Returns
Section titled “Returns”void
setDefaultCursorStyle()
Section titled “setDefaultCursorStyle()”setDefaultCursorStyle(
style?):void
Parameters
Section titled “Parameters”style?
Section titled “style?”Returns
Section titled “Returns”void
setDefaultForegroundColor()
Section titled “setDefaultForegroundColor()”setDefaultForegroundColor(
color?):void
Parameters
Section titled “Parameters”color?
Section titled “color?”Returns
Section titled “Returns”void
setDefaultPalette()
Section titled “setDefaultPalette()”setDefaultPalette(
palette?):void
Parameters
Section titled “Parameters”palette?
Section titled “palette?”readonly RgbColor[]
Returns
Section titled “Returns”void
setMode()
Section titled “setMode()”setMode(
mode,enabled):void
Parameters
Section titled “Parameters”TerminalMode
enabled
Section titled “enabled”boolean
Returns
Section titled “Returns”void
setScrollbackByteLimit()
Section titled “setScrollbackByteLimit()”setScrollbackByteLimit(
limit?):void
Both budgets apply independently. Zero erases history and disables further scrollback.
Parameters
Section titled “Parameters”limit?
Section titled “limit?”number
Returns
Section titled “Returns”void
setScrollbackLimit()
Section titled “setScrollbackLimit()”setScrollbackLimit(
limit?):void
Native pruning removes whole historical pages and permits at least one page of rows. The retained count can fall below or exceed this budget. Undefined removes the line limit.
Parameters
Section titled “Parameters”limit?
Section titled “limit?”number
Returns
Section titled “Returns”void
subscribeCustomOsc()
Section titled “subscribeCustomOsc()”subscribeCustomOsc(
number,generation,observe,canCapture?): () =>void
Parameters
Section titled “Parameters”number
Section titled “number”number
generation
Section titled “generation”number
observe
Section titled “observe”(observation) => void
canCapture?
Section titled “canCapture?”() => boolean
Returns
Section titled “Returns”() => void
write()
Section titled “write()”write(
value):void
Parameters
Section titled “Parameters”string | Uint8Array<ArrayBufferLike>
Returns
Section titled “Returns”void