public class TerminalWidget extends TabWidget:
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")| Modifier and Type | Member | Description |
|---|---|---|
| public readonly property | activeTerminalactiveTerminal as TerminalView: |
Active terminal session, or null when no tab is open. |
| public property | commandcommand as String: |
Shell command used by newly opened tabs. |
| public readonly property | isRunningisRunning as Boolean: |
True when at least one terminal tab is still running. |
| public property | singleTerminalsingleTerminal as Boolean: |
When true, the widget exposes exactly one terminal and hides the tab bar. |
| Modifier and Type | Member | Description |
|---|---|---|
| public signal property | cwdcwd as String: |
Current working directory used for newly opened terminal tabs. |
| Modifier and Type | Member | Description |
|---|---|---|
| public event | terminatedterminated as ActionEvent |
Emitted when the last terminal tab is closed or terminated. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | TerminalWidgetTerminalWidget(command as String = "", cwd as String = "", terminalFont as String = "", fontSize as Int = 15): |
Creates a terminal tab container and opens the first tab. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | applyFont | Applies terminal font settings to all existing tabs and future tabs. |
| public | closeclose() as Void: |
Closes every terminal tab and stops their pseudo-terminal processes. |
| public override | onTabClosedonTabClosed(widget as Widget) as Void: |
No summary. |
| public override | onTabSelectedonTabSelected(widget as Widget) as Void: |
No summary. |
| public | openTerminalopenTerminal(cwd as String = "") as TerminalView: |
Opens a new terminal tab. |
| public | runCommandrunCommand(command as String) as Void: |
Runs a command in the active terminal, opening one when needed. |