CommandLineEditors 0.2.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package CommandLineEditors --version 0.2.0                
NuGet\Install-Package CommandLineEditors -Version 0.2.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="CommandLineEditors" Version="0.2.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CommandLineEditors --version 0.2.0                
#r "nuget: CommandLineEditors, 0.2.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.
// Install CommandLineEditors as a Cake Addin
#addin nuget:?package=CommandLineEditors&version=0.2.0

// Install CommandLineEditors as a Cake Tool
#tool nuget:?package=CommandLineEditors&version=0.2.0                

CommandLineEditors Library

This library provides editors for the command line that can be used as a replacement for the standard System.Console.ReadLine() method call.

Currently there is only one line-editor fully implemented, which emulates the ReadLine library, similar to a Emacs key-binding.

An early version of VI key-bindings is also in this library at the current state, but we do not recommend using this.

Quick Start

If you just want to get a replacement of the C# standard function Console.ReadLine() the ReadLineEditor is probably the best way to start with. It provides a key-binding which implements 95% of the well-known readline-libray key kindings people usually encounter on terminals in Linux.

To start with this editor, you have to add one using-statement and also create an instance of this editor, because the editor holds a history of what the user typed to make it available throught the up and down-arrow keys.

Here is a small program which repeatedly reads a single line from the console until the user enters an empty line:

using CommandLineEditors.Editor.ReadLine;

namespace CommandLineEditors.Demo
{
    internal class Program
    {
        private static void Main(string[] args)
        {
            TestConsoleInput();
        }

        public static void TestConsoleInput()
        {
            ReadLineEditor readLineInterface = new ReadLineEditor();

            string result = "-not-empty-to-start-with-";
            while (!string.IsNullOrEmpty(result))
            {
                System.Console.Write("> ");
                result = readLineInterface.ReadLine();
                System.Console.WriteLine();
                System.Console.WriteLine($"result: '{result}'");
            }
        }

    }
}
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
0.3.6 130 3/27/2024
0.3.5 132 3/26/2024
0.3.4 130 3/18/2024
0.3.3 112 3/18/2024
0.3.2 120 3/18/2024
0.3.0 119 3/15/2024
0.2.6 101 3/15/2024
0.2.5 110 3/14/2024
0.2.3 300 1/2/2022
0.2.2 259 1/2/2022
0.2.1 262 1/2/2022
0.2.0 250 12/30/2021
0.1.0 313 8/30/2021