Class TerminalBuilder
- Namespace
- SharpConsoleUI.Builders
- Assembly
- SharpConsoleUI.dll
Fluent builder for creating a TerminalControl. Supported platforms: Linux (openpty), Windows 10 1809+ (ConPTY).
public class TerminalBuilder
- Inheritance
-
TerminalBuilder
- Inherited Members
- Extension Methods
Methods
Build()
Returns a self-contained TerminalControl (PTY open, shim running, read loop active).
public TerminalControl Build()
Returns
Open(ConsoleWindowSystem, int?, int?)
Convenience: builds a TerminalControl and opens a default centered window.
public void Open(ConsoleWindowSystem ws, int? width = null, int? height = null)
Parameters
wsConsoleWindowSystemThe window system to open the terminal in.
widthint?Terminal columns. Defaults to desktop width minus 6, minimum 60.
heightint?Terminal rows. Defaults to desktop height minus 6, minimum 20.
WithArgs(params string[])
Sets the arguments passed to the executable.
public TerminalBuilder WithArgs(params string[] a)
Parameters
astring[]
Returns
WithBackgroundColor(Color)
Sets the VT100's default background color (SGR 49 / cleared cells). Pass Transparent (A=0) to make empty terminal cells emit SGR 49 so the host terminal's own background (or its transparency) shows through.
public TerminalBuilder WithBackgroundColor(Color color)
Parameters
colorColor
Returns
WithExe(string)
Sets the executable to launch inside the terminal.
public TerminalBuilder WithExe(string exe)
Parameters
exestring
Returns
WithLogService(ILogService?)
Attaches a log service so PTY lifecycle events are recorded under the "PTY"/"Terminal" categories.
public TerminalBuilder WithLogService(ILogService? logService)
Parameters
logServiceILogService
Returns
WithWorkingDirectory(string?)
Sets the working directory for the spawned process.
public TerminalBuilder WithWorkingDirectory(string? dir)
Parameters
dirstring