Webmaster442.WindowsTerminal 1.1.1

dotnet add package Webmaster442.WindowsTerminal --version 1.1.1                
NuGet\Install-Package Webmaster442.WindowsTerminal -Version 1.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="1.1.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Webmaster442.WindowsTerminal --version 1.1.1                
#r "nuget: Webmaster442.WindowsTerminal, 1.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.
// Install Webmaster442.WindowsTerminal as a Cake Addin
#addin nuget:?package=Webmaster442.WindowsTerminal&version=1.1.1

// Install Webmaster442.WindowsTerminal as a Cake Tool
#tool nuget:?package=Webmaster442.WindowsTerminal&version=1.1.1                

Webmaster442.WindowsTerminal

logo

A Windows Terminal Interaction libary

Features

Install a terminal Fragment extension

const string appName = "Webmaster442.WindowsTerminalDemo";
const string fragmentName = "demoApp.json";
if (!WindowsTerminal.FragmentExtensions.IsFragmentInstalled(appName, fragmentName))
{
    bool result = await WindowsTerminal.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

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

Set window title and Display progress bar:

WindowsTerminal.SetWindowTitle("Progressbar demo");
WindowsTerminal.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());
Product Compatible and additional computed target framework versions.
.NET 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net9.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.1 72 1/26/2025
1.1.0 68 1/25/2025
1.0.0 80 1/25/2025