TerminalView
classin packageklyn.gui.windows
public class TerminalView extends Canvas
└ Canvas
└ TerminalView

Reusable interactive terminal widget backed by PseudoTerminal.

TerminalView is intentionally part of the GUI library, not the editor tool, so applications can embed a real shell-like terminal with keyboard input, ANSI line editing, scrolling and process lifecycle notification. In a docked tab surface, that surface owns the frame and focus contour; the terminal paints a flat background without an additional inner border.

terminal = TerminalView()
terminal.terminated += lambda(e as ActionEvent): print("shell closed")
terminal.runCommand("pwd")
Properties
Modifier and Type Member Description
public readonly property isRunning
isRunning as Boolean
True while the backing pseudo-terminal process is still running.
public readonly property workingDirectory
workingDirectory as String
Current working directory of the underlying shell.
Inherited Properties
propertyInherited Properties from Widget: accentColor, acceptFileDrops, backgroundColor, borderColor, bottom, canFocus, cornerRadius, cursor, font, foregroundColor, hasFocus, height, isEnabled, isHovered, isManaged, isPressed, isTabStop, isVisible, layoutParams, margin, maxHeight, maxWidth, minHeight, minWidth, parent, preferredHeight, preferredWidth, resolvedStyleCache, resolvedStyleCacheAppearanceMode, resolvedStyleCacheFont, resolvedStyleCacheRevision, resolvedStyleCacheStateKey, resolvedStyleCacheStyleClass, resolvedStyleCacheZoomRevision, right, size, sizePolicy, styleClass, toolTip, width, window, x, y
Signals
Modifier and Type Member Description
public signal property cwd
cwd as String
Current working directory tracked by the terminal.
Events
Modifier and Type Member Description
public event terminated
terminated as ActionEvent
Emitted when the underlying pseudo-terminal process exits.
Inherited Events
eventInherited Events from Widget: filesDropped, focusGained, focusLost, keyPressed, keyReleased, mouseMoved, mousePressed, mouseReleased, mouseWheel, paintRequested, resized
Constructors
Modifier and Type Member Description
public TerminalView
TerminalView(command as String = "", cwd as String = "", terminalFont as String = "", fontSize as Int = 14)
Creates and starts a terminal.
Methods
Modifier and Type Member Description
public append
append(line as String) as Void
Appends text to the terminal display without writing to the shell.
public applyFont
applyFont(terminalFont as String = "", fontSize as Int = 14) as Void
Updates the rendered font and recomputes the terminal geometry.
public close
close() as Void
Stops polling and closes the underlying pseudo-terminal.
public override handleTabKey
handleTabKey(backward as Boolean) as Boolean
Sends Tab or Shift+Tab to the terminal instead of moving focus.
public override paint
paint(painter as Painter) as Void
No summary.
public runCommand
runCommand(command as String) as Void
Writes a command followed by the terminal Enter sequence.
Inherited Methods
methodInherited Methods from Widget: applyThemeMetrics, blur, containsPoint, emitFilesDropped, emitFocusGained, emitFocusLost, emitKeyPressed, emitKeyReleased, emitMouseMoved, emitMousePressed, emitMouseReleased, emitMouseWheel, handleTabKey, notifyPaintRequested, paint, paintClipped, paintForeground, paintOverlay, preferredSizeIncludesContentZoom, repaint, requestFocus, resolvePreferredHeight, resolvePreferredWidth, resolvedFont, setBounds