Webmaster442.WindowsTerminal
3.0.1
dotnet add package Webmaster442.WindowsTerminal --version 3.0.1
NuGet\Install-Package Webmaster442.WindowsTerminal -Version 3.0.1
<PackageReference Include="Webmaster442.WindowsTerminal" Version="3.0.1" />
<PackageVersion Include="Webmaster442.WindowsTerminal" Version="3.0.1" />
<PackageReference Include="Webmaster442.WindowsTerminal" />
paket add Webmaster442.WindowsTerminal --version 3.0.1
#r "nuget: Webmaster442.WindowsTerminal, 3.0.1"
#addin nuget:?package=Webmaster442.WindowsTerminal&version=3.0.1
#tool nuget:?package=Webmaster442.WindowsTerminal&version=3.0.1
Webmaster442.WindowsTerminal
A Windows Terminal Interaction libary
Installation
Via NuGet: https://www.nuget.org/packages/Webmaster442.WindowsTerminal
Sixel support addon package (Uses SixLabors.ImageSharp): https://www.nuget.org/packages/Webmaster442.WindowsTerminal.Sixel
Via .NET Cli:
dotnet add package Webmaster442.WindowsTerminal
dotnet add package Webmaster442.WindowsTerminal.Sixel
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());
Create a Sixel image:
Note : This feature requires the Webmaster442.WindowsTerminal.Sixel package
Console.WriteLine($"Sixel is supported: {Sixel.IsSupported}");
var imagePath = Path.Combine(AppContext.BaseDirectory, "512x512.png");
var img = Sixel.ImageToSixel(imagePath);
Console.Write(img);
Product | Versions 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. |
-
net8.0
- System.Text.Json (>= 9.0.3)
-
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.