![]() |
VOOZH | about |
dotnet add package XtermBlazor --version 2.4.0
NuGet\Install-Package XtermBlazor -Version 2.4.0
<PackageReference Include="XtermBlazor" Version="2.4.0" />
<PackageVersion Include="XtermBlazor" Version="2.4.0" />Directory.Packages.props
<PackageReference Include="XtermBlazor" />Project file
paket add XtermBlazor --version 2.4.0
#r "nuget: XtermBlazor, 2.4.0"
#:package XtermBlazor@2.4.0
#addin nuget:?package=XtermBlazor&version=2.4.0Install as a Cake Addin
#tool nuget:?package=XtermBlazor&version=2.4.0Install as a Cake Tool
<img align="right" width="100" height="100" src="https://github.com/BattlefieldDuck/XtermBlazor/assets/29337428/244eb056-4bb1-43a2-85b4-1909034c3ddf">
👁 Dotnet Package
👁 NuGet Version
👁 NuGet Downloads
Brings xterm.js to Blazor
Live Demo: https://xtermblazor.pages.dev
Before you get started with this project, make sure you have the following software installed on your system:
Find the package through NuGet Package Manager or install it with following command.
dotnet add package XtermBlazor
After the package is added, you need to add the following in your _Imports.razor
@using XtermBlazor
Add the following to your HTML head section, it's either index.html or _Host.cshtml depending on whether you're running WebAssembly or Server.
<link href="_content/XtermBlazor/XtermBlazor.min.css" rel="stylesheet" />
In the HTML body section of either index.html or _Host.cshtml add this:
<script src="_content/XtermBlazor/XtermBlazor.min.js"></script>
<Xterm @ref="_terminal" Options="_options" OnFirstRender="@OnFirstRender" />
@code {
private Xterm _terminal;
private TerminalOptions _options = new TerminalOptions
{
CursorBlink = true,
CursorStyle = CursorStyle.Bar,
Theme =
{
Background = "#17615e",
},
};
private async Task OnFirstRender()
{
await _terminal.WriteLine("Hello World");
}
}
Xterm supports Addons
To use @xterm/addon-fit addon, you need to add the following to your HTML body section either index.html or _Host.cshtml.
Blazor WebAssembly index.html
<script src="https://cdn.jsdelivr.net/npm/@xterm/addon-fit@0.11.0/lib/addon-fit.min.js"></script>
<script src="_framework/blazor.webassembly.js"></script>
<script>navigator.serviceWorker.register('service-worker.js');</script>
<script src="_content/XtermBlazor/XtermBlazor.min.js"></script>
<script>XtermBlazor.registerAddons({"addon-fit": new FitAddon.FitAddon()});</script>
Blazor Server _Host.cshtml
<script src="https://cdn.jsdelivr.net/npm/@@xterm/addon-fit@0.11.0/lib/addon-fit.min.js"></script>
<script src="_framework/blazor.server.js"></script>
<script src="_content/XtermBlazor/XtermBlazor.min.js"></script>
<script>XtermBlazor.registerAddons({"addon-fit": new FitAddon.FitAddon()});</script>
<Xterm @ref="_terminal" Options="_options" Addons="_addons" OnFirstRender="@OnFirstRender" />
@code {
private Xterm _terminal;
private TerminalOptions _options = new TerminalOptions
{
CursorBlink = true,
CursorStyle = CursorStyle.Bar,
};
private HashSet<string> _addons = new HashSet<string>()
{
"addon-fit",
};
private async Task OnFirstRender()
{
// Invoke fit() function
await _terminal.Addon("addon-fit").InvokeVoidAsync("fit");
await _terminal.WriteLine("Hello World");
}
}
Contributions are welcome! Please feel free to submit pull requests or open issues.
XtermBlazor is licensed under the MIT License. See the LICENSE file for more details.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 net6.0 is compatible. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 is compatible. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 2 NuGet packages that depend on XtermBlazor:
| Package | Downloads |
|---|---|
|
Quick.Blazor.Bootstrap.Terminal
Quick.Blazor.Bootstrap.Terminal is a component library for Terminal built on top of Blazor and CSS frameworks Bootstrap. |
|
|
MoonlightPluginBase
Use this package to install all dependencies a moonlight plugins needs |
Showing the top 3 popular GitHub repositories that depend on XtermBlazor:
| Repository | Stars |
|---|---|
|
MattParkerDev/SharpIDE
A modern, cross platform IDE for .NET, built with .NET & Godot
|
|
| LANCommander/LANCommander | |
|
weibaohui/blazork8s
manage k8s using c# blazor enhance by chatgpt ,try something new !使用blazor技术开发的内置OpenAI GPT的k8s 管理界面
|
| Version | Downloads | Last Updated |
|---|---|---|
| 2.4.0 | 676 | 5/4/2026 |
| 2.3.0 | 5,849 | 12/23/2025 |
| 2.2.0 | 3,440 | 9/29/2025 |
| 2.1.2 | 34,918 | 9/18/2024 |
| 2.1.1 | 3,734 | 7/10/2024 |
| 2.1.0 | 4,760 | 4/16/2024 |
| 2.0.0 | 870 | 3/8/2024 |
| 1.10.2 | 8,569 | 2/5/2024 |
| 1.10.1 | 292 | 1/29/2024 |
| 1.10.0 | 2,663 | 9/27/2023 |
| 1.9.0 | 4,017 | 6/28/2023 |
| 1.8.1 | 2,131 | 3/22/2023 |
| 1.8.0 | 427 | 3/22/2023 |
| 1.7.0 | 728 | 2/19/2023 |
| 1.6.1 | 6,914 | 9/20/2022 |
| 1.6.0 | 706 | 9/18/2022 |
| 1.5.2 | 729 | 9/7/2022 |
| 1.5.1 | 618 | 9/2/2022 |
| 1.5.0 | 1,210 | 4/13/2022 |
| 1.4.0 | 699 | 2/22/2022 |