Konsole
Home of the simple console library consisting of ProgressBar, Window, Form, Draw & MockConsole (C# console progress bar with support for single or multithreaded progress updates) Window is a 100%-ish console compatible window, supporting all normal console writing to a windowed section of the screen, supporting scrolling and clipping of console output.
Install / Use
/learn @goblinfactory/KonsoleREADME
<img src="docs/konsole.png" height="30px" valign='bottom'/> Konsole V6
Low ceremony, Fluent DSL for writing console apps, utilities and spike projects. Providing thread safe progress bars, windows and forms and drawing for console applications. Build UX's as shown below in very few lines of code. Konsole provides simple threadsafe ways to write to the C# console window. See my notes on threading. The project is growing quickly with fast responses to issues raised.
Private beta for version 7 and 8.
Update : 28 April 2024 : I'm busy planning version 7 and version 8 of Konsole, but need to know who's using it and how much effort to allocate to these two important releases. If you're actively using Konsole, then it's important that you please connect with me on Linkedin so that I can collect discrete input from users on how they're using Konsole, and to makes sure that I work on the features that will add most value to users.
Connect with Alan on LinkedIn in for access to version 7 and 8.
Version 7 and 8 is going to start out as a private beta (by invitation only) You must connect with me in order to be allowed to use it. I may update the licence to say you need to be connected.
Version 7 and 8 version will focus on features related to; (among other critical updates)
- Input handling inside windows.
- Deeper security updates necessary for a new AI world.
- Docker and cloud native support : Write cloud services as Konsole apps.
- Full high speed cross platform support, Nix, OSX, Windows.
- AI integrations. (Default Konsole UI's for building AI powered Konsole apps)
General help on any version
If you have any questions on how to use Konsole, please join us on Gitter (https://gitter.im/goblinfactory-konsole/community?source=orgpage) and I'll be happy to help you.
Version 7 alpha release progress (see release notes for whats new)
| date | alpha release |
| --- | --- |
| 11/2/21 | (7.0.0.5-alpha)[https://www.nuget.org/packages/Goblinfactory.Konsole/7.0.0.5-alpha] |
| 13/2/21 | (7.0.0.7-alpha)[https://www.nuget.org/packages/Goblinfactory.Konsole/7.0.0.7-alpha] |
enjoy, cheers,
Alan

Contents : V6
- Installing and getting started
- using static Console.ConsoleColor
- Debugging inside VSCode
- IConsole
- ConcurrentWriter
- Progress Bars
- Threading and threadsafe writing to the Console.
- Window
- Floating constructors
- Inline constructors
- Fullscreen constructor
- Static constructors
- methods and extension methods
- Nested Windows
- Window properties
- Advanced windows with SplitRows and SplitColumns
- Input
- Clipping and Transparency
- Draw
- Forms
- HighSpeedWriter
- Copying code from the unit tests
- Other .NET console libraries
- Why did I write Konsole?
- Debugging problems with Konsole
- MockConsole
- Building the solution
- ChangeLog
- support me, please check out Snowcode, a free developer conference I hold every year at a great ski venue
Nuget Packages
- https://nuget.org/packages/Goblinfactory.Konsole/
- https://nuget.org/packages/Goblinfactory.Konsole.Windows/
Installing and Getting started
- start a new console application
dotnet new console -n myutility
- add
Konsolepackage
dotnet add package Goblinfactory.Konsole
- add the code in the same shown below to your
void main(string[] args)method - run your program
dotnet run
Will give you the screenshot on the right. If not, please join our gitter chat and get some help.
have fun!
Alan
<img src='docs/img/02-nyse-ftse100.png' width='200' align='right'/>
using Konsole.Internal;
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using static System.ConsoleColor;
class Program
{
static void Main(string[] args)
{
// quick dive in example
void Wait() => Console.ReadKey(true);
// show how you can mix and match System.Console with Konsole
Console.WriteLine("line one");
// create an inline Box window at the current cursor position
// 20 characters wide, by 12 tall.
// returns a Window that implements IConsole
// that you can use to write to the window
// and create new windows inside that window.
var nyse = Window.OpenBox("NYSE", 20, 12, new BoxStyle() {
ThickNess = LineThickNess.Single,
Title = new Colors(White, Red)
});
Console.WriteLine("line two");
// create another inline Box window at the current cursor position
var ftse100 = Window.OpenBox("FTSE 100", 20, 12, new BoxStyle() {
ThickNess = LineThickNess.Double,
Title = new Colors(White, Blue)
});
Console.Write("line three");
while(true) {
Tick(nyse, "AMZ", amazon -= 0.04M, Red, '-', 4.1M);
Tick(ftse100, "BP", bp += 0.05M, Green, '+', 7.2M);
Wait();
}
decimal amazon = 84;
decimal bp = 146;
// simple method that takes a window and prints a stock price
// to that window in color
void Tick(IConsole con, string sym, decimal newPrice,
ConsoleColor color, char sign, decimal perc)
{
con.Write(White, $"{sym,-10}");
con.WriteLine(color, $"{newPrice:0.00}");
con.WriteLine(color, $" ({sign}{newPrice}, {perc}%)");
con.WriteLine("");
}
}
}
using static Console.ConsoleColor
If you will be using a lot of different colors throughout your application I recommend making use of the new C# static using language feature to make the code a bit easier to read.
before
Console.WriteLine(ConsoleColor.Red, "I am red");
var box = Window.OpenBox("warnings", new BoxStyle() { Title = new Colors(ConsoleColor.White, ConsoleColor.Red) })
becomes
using static System.Console;
...
Console.WriteLine(Red, "I am red");
var box = Window.OpenBox("warnings", new BoxStyle() { Title = new Colors(White, Red) })
IConsole
This is the main interface that all windows, and objects that wrap a window, or that wrap the System.Console writer. It implements the almost everything that System.Console does with some extra magic. IConsole is a well thought out .NET System.Console abstractions. Use to remove a direct dependancy on System.Console and replace with a dependancy on a well used and well known console interface, IConsole, to allow for building rich 'testabl
