Webmaster442.WindowsTerminal 4.0.0

dotnet add package Webmaster442.WindowsTerminal --version 4.0.0
                    
NuGet\Install-Package Webmaster442.WindowsTerminal -Version 4.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Webmaster442.WindowsTerminal" Version="4.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Webmaster442.WindowsTerminal" Version="4.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Webmaster442.WindowsTerminal" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Webmaster442.WindowsTerminal --version 4.0.0
                    
#r "nuget: Webmaster442.WindowsTerminal, 4.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=Webmaster442.WindowsTerminal&version=4.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Webmaster442.WindowsTerminal&version=4.0.0
                    
Install as a Cake Tool

Webmaster442.WindowsTerminal

logo

A Windows Terminal Interaction libary

Installation

Via NuGet: https://www.nuget.org/packages/Webmaster442.WindowsTerminal

Via .NET Cli:

dotnet add package Webmaster442.WindowsTerminal

Features

Install a terminal Fragment extension

const string appName = "Webmaster442.WindowsTerminalDemo";
const string fragmentName = "demoApp.json";
if (!Terminal.FragmentExtensions.IsFragmentInstalled(appName, fragmentName))
{
    bool result = await Terminal.FragmentExtensions.TryInstallFragmentAsync(appName, fragmentName, new TerminalFragment()
    {
        Profiles = 
        {
            new TerminalProfile
            {
                Name = "Webmaster442.WindowsTerminalDemo",
                CommandLine = Path.Combine(AppContext.BaseDirectory, "Demo.exe"),
                StartingDirectory = EnvironmentVariables.HomePath,
            }
        }
    });
}
else
{
    Console.WriteLine("Fragment already installed");
}

Send shell integration marks

Terminal.SetWindowTitle("Shell integration demo");
Terminal.ShellIntegration.StartOfPrompt();
Console.Write("Enter a command >");
Terminal.ShellIntegration.CommandStart();
string? command = Console.ReadLine();
Terminal.ShellIntegration.CommandExecuted();
Console.WriteLine($"Command: {command}");
Terminal.ShellIntegration.CommandFinished(0);

Set window title and Display progress bar:

Terminal.SetWindowTitle("Progressbar demo");
Terminal.SetProgressbar(ProgressbarState.Default, 50);

Write Formatted string to the terminal:

TerminalFormattedStringBuilder builder = new();
Console.WriteLine(builder
    .New()
    .WithBackgroundColor("#e2eef9")
    .WithForegroundColor("#000000")
    .WithBold()
    .AppendLine("24 bit color")
    .ResetFormat());

Create a DECPS sound:

MusicStringBuilder music = new();
music.AddNote(6, TimeSpan.FromSeconds(1), Note.C5);
music.AddNote(6, TimeSpan.FromSeconds(1), Note.D5);
music.AddNote(6, TimeSpan.FromSeconds(1), Note.E5);
music.AddNote(6, TimeSpan.FromSeconds(1), Note.F5);
music.AddNote(6, TimeSpan.FromSeconds(1), Note.G5);
music.AddNote(6, TimeSpan.FromSeconds(1), Note.A5);
music.AddNote(6, TimeSpan.FromSeconds(1), Note.B5);
Console.Write(music.ToString());

Create a Sixel image:

Note : This feature requires the Webmaster442.WindowsTerminal.ImageSharp or Webmaster442.WindowsTerminal.SkiaSharp package.


Console.WriteLine($"Sixel is supported: {Terminal.IsSixelSupported}");

var imagePath = Path.Combine(AppContext.BaseDirectory, "512x512.png");
var img = ImageSharpSixelImage.FromFile(imagePath);
Console.Write(img);

var imagePath = Path.Combine(AppContext.BaseDirectory, "512x512.png");
var img = SkiaSharpSixelImage.FromFile(imagePath);
Console.Write(img);
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Webmaster442.WindowsTerminal:

Package Downloads
Webmaster442.WindowsTerminal.ImageSharp

A windows terminal interaction libary, adds Sixel encoding via ImageSharp

Webmaster442.WindowsTerminal.SkiaSharp

A windows terminal interaction libary, adds Sixel encoding via ImageSharp

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.0 250 6/9/2025
3.0.1 178 3/27/2025
3.0.0 146 3/16/2025
2.0.0 157 2/2/2025
1.1.1 108 1/26/2025
1.1.0 129 1/25/2025
1.0.0 118 1/25/2025