Webmaster442.WindowsTerminal 4.1.1

dotnet add package Webmaster442.WindowsTerminal --version 4.1.1
                    
NuGet\Install-Package Webmaster442.WindowsTerminal -Version 4.1.1
                    
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.1.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Webmaster442.WindowsTerminal" Version="4.1.1" />
                    
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.1.1
                    
#r "nuget: Webmaster442.WindowsTerminal, 4.1.1"
                    
#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.
#:package Webmaster442.WindowsTerminal@4.1.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Webmaster442.WindowsTerminal&version=4.1.1
                    
Install as a Cake Addin
#tool nuget:?package=Webmaster442.WindowsTerminal&version=4.1.1
                    
Install as a Cake Tool

Webmaster442.WindowsTerminal

logo

A Windows Terminal Interaction libary

Installation

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

Sixel support requires one of the following addon packages:

Two flavors are provided to allow users to pick their preferred image processing library without forcing a dependency on one or the other.

Via .NET Cli:

dotnet add package Webmaster442.WindowsTerminal

For sixel graphics support, add one of the following packages:

dotnet add package Webmaster442.WindowsTerminal.ImageSharp

or

dotnet add package Webmaster442.WindowsTerminal.SkiaSharp

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 is compatible.  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.
  • net10.0

    • No dependencies.
  • net8.0

  • net9.0

    • No dependencies.

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.1.1 266 11/13/2025
4.1.0 295 11/13/2025
4.0.0 392 6/9/2025
3.0.1 295 3/27/2025
3.0.0 215 3/16/2025
2.0.0 198 2/2/2025
1.1.1 146 1/26/2025
1.1.0 186 1/25/2025
1.0.0 157 1/25/2025

# 4.1.1
- Corrected readme mistakes
- Added release notes
# 4.1.0
- .NET 10 support
# 4.0
- Reworked Sixel support. Sixel support is available via Webmaster442.WindowsTerminal.SkiaSharp or the Webmaster442.WindowsTerminal.ImageSharp package, depending on the backend that you want to use for image decoding.
- Added SixelEncoder class that exposes the Sixel encoder
- New overrides in the TerminalFormattedStringBuilder that accept a Color instance
- Added AppendLink function to TerminalFormattedStringBuilder
# 3.0.0
- Colors can now be specified in hsl() and rgb() CSS format in the TerminalFormattedStringBuilder.WithForegroundColor(string color) and TerminalFormattedStringBuilder.WithBackgroundColor(string color) methods.
- WindowsTerminal class now has a GetPaletteColor(int index) method, that returns the color of the specified palette index.
- Added support for actions in Fragment extensions. The TerminalCommand class has some predefined actions.
- Added more themes into the TerminalSchemes class
- Sixel.ImageToSixel: Image is now properly resized, instead of cropped, if the image is larger than the specified size.
- Added Pager widget, that can diplay a large amount of text in a paginated way.
- Added ProgressBar widget, that can display a progress bar.
- Added Sixel.GetTerminalWindowSize() method, that returns the current terminal window size in pixels.
- Sixel.ImageToSixel: Removed versions where the maxSize can be specied as a tuple. Use the new Sixel.ImageToSixel variants, that accept a SixelOptions instead.
# 2.0.0
- Added .NET 8 support
- Libary is now AOT compatible
- TerminalProfile class now has static factory methods for creating profiles for Anaconda3, Cmder, Cygwin, Far and Gith Bash
- TerminalFragment class now has a ToJson() method that converts the fragment to a JSON string.
- Nullability changes of TerminalProfile class: Icon, TabTitle, ColorScheme and BackgroundImage are now nullable and by default have null values.
- TerminalProfile class new properties:
- ShowMarksOnScrollbar, AutoMarkPrompts for Shell integration support
- Font to specify font settings
- Sixel image support via the Webmaster442.Windowsterminal.Sixel package. This package depends on Sixlabors.ImageSharp
# 1.1.1
- Fixes Json fragment generation of enum values
# 1.1.0
- Added char overload for Append
- Added object overload for Append
- WithBackgroundColor and WithForegroundColor now accept ConsoleColor as well