TerminalWidget
class in package klyn.gui.windows

    public class TerminalWidget extends TabWidget:

Widget
└ Container
└ TabWidget
└ TerminalWidget

Multi-tab terminal widget.

`TerminalWidget` hosts one or more `TerminalView` sessions in closable tabs. A leading `+` button opens a new terminal on the widget `cwd`, which follows the active terminal's current working directory when it is known.

    terminal = TerminalWidget(cwd=Path.cwd.toString())
    terminal.runCommand("klyn --version")

Properties

Modifier and Type | Member | Description
--- | --- | ---
public readonly property | activeTerminal `activeTerminal as TerminalView:` | Active terminal session, or `null` when no tab is open.
public property | command `command as String:` | Shell command used by newly opened tabs.
public readonly property | isRunning `isRunning as Boolean:` | True when at least one terminal tab is still running.
public property | singleTerminal `singleTerminal as Boolean:` | When true, the widget exposes exactly one terminal and hides the tab bar.

Inherited Properties
property Inherited Properties from TabWidget: activeIndex, activeTitle, activeWidget, addButtonWidth, childCount, closeAreaWidth, showAddButton, showTabBar, tabHeight, tabPosition
property Inherited Properties from Container: autoRelayout, childCount, layout, padding
property Inherited Properties from Widget: accentColor, backgroundColor, borderColor, bottom, canFocus, cornerRadius, cursor, font, foregroundColor, hasFocus, height, isEnabled, isHovered, isManaged, 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 used for newly opened terminal tabs.

Events

Modifier and Type | Member | Description
--- | --- | ---
public event | terminated `terminated as ActionEvent` | Emitted when the last terminal tab is closed or terminated.

Inherited Events
event Inherited Events from TabWidget: addTabRequested, tabClosed
event Inherited Events from Widget: keyPressed, keyReleased, mouseMoved, mousePressed, mouseReleased, mouseWheel, paintRequested, resized
Constructors

Modifier and Type | Member | Description
--- | --- | ---
public | TerminalWidget `TerminalWidget(command as String = "", cwd as String = "", terminalFont as String = "", fontSize as Int = 15):` | Creates a terminal tab container and opens the first tab.

Methods

Modifier and Type | Member | Description
--- | --- | ---
public | applyFont `applyFont(terminalFont as String = "", fontSize as Int = 15) as Void:` | Applies terminal font settings to all existing tabs and future tabs.
public | close `close() as Void:` | Closes every terminal tab and stops their pseudo-terminal processes.
public override | onTabClosed `onTabClosed(widget as Widget) as Void:` | No summary.
public override | onTabSelected `onTabSelected(widget as Widget) as Void:` | No summary.
public | openTerminal `openTerminal(cwd as String = "") as TerminalView:` | Opens a new terminal tab.
public | runCommand `runCommand(command as String) as Void:` | Runs a command in the active terminal, opening one when needed.

Inherited Methods
method Inherited Methods from TabWidget: addTab, applyLayout, closeTab, findTab, isModifiedAt, onTabClosed, onTabSelected, paint, select, setBounds, setModifiedAt, setTitleAt, titleAt, widgetAt
method Inherited Methods from Container: add, applyLayout, attachWindow, children, clear, paintOverlay, remove, withLayout
method Inherited Methods from Widget: blur, containsPoint, emitKeyPressed, emitKeyReleased, emitMouseMoved, emitMousePressed, emitMouseReleased, emitMouseWheel, handleTabKey, notifyPaintRequested, paint, paintClipped, paintOverlay, repaint, requestFocus, resolvePreferredHeight, resolvePreferredWidth, resolvedFont, setBounds
Inherited Operators
operator Inherited Operators from Container: operator[](index as Int) as Widget:, operator[](index as UInt) as Widget: