BptTerminalClient
The BptTerminalClient component provides an interactive web-based terminal emulator with multiple theme options (MATE Desktop, Amiga Workbench 1.3, Amiga Workbench 3.1, MS-DOS, Commodore 64). It supports multi-tab sessions, real shell access with PTY allocation, full color support, and interactive programs. In Server mode, commands execute directly on the server via process piping. In WebAssembly mode, commands are routed through a SignalR hub to the server. Use Sandbox mode for safe demo environments with a fake filesystem. Requires one line of setup in Program.cs: app.MapBptTerminalHub()
Terminal Parameters
Terminal client demo
Current Configuration
Available Shells by Platform
Windows
powershell.exe— Windows PowerShell 5.xcmd.exe— Command Prompt
pwsh for PowerShell 7+ (cross-platform).macOS
/bin/zsh— Default shell (macOS Catalina+)/bin/bash— Bourne Again Shell
script for full color and interactive support.Linux
/bin/bash— Default on most distros/bin/sh— POSIX shell/bin/zsh— Z Shell (if installed)
script for full color and interactive support.The Shell dropdown only shows shells available on the current server platform. Each new tab uses the currently selected shell.
Security Warning
BptTerminalClient provides real shell access to the server when Sandbox mode is disabled. Any user with access can execute arbitrary commands with the permissions of the application's process identity.
- Never expose a non-sandboxed terminal to the public internet.
- Always enable
Sandboxmode for demo or public-facing deployments. - Place the terminal behind authentication and authorization.
- Run the application under a least-privilege service account.
- Use
BlockedCommandsas defense-in-depth only, not as a primary security measure. - Consider network segmentation and container isolation for production use.
Program.cs Setup
Add the following to your Program.cs to enable BptTerminalClient:
using Bpt.Components.Tools;
// SignalR is required (already added if using Blazor Server)
builder.Services.AddSignalR();
// Map the terminal hub endpoint (after MapBlazorHub)
app.MapBptTerminalHub();
The hub endpoint defaults to /bpt-terminalhub. Override with app.MapBptTerminalHub("/custom-path").