CommandLineEditors 0.2.1

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

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

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 78 3/27/2024
0.3.5 65 3/26/2024
0.3.4 93 3/18/2024
0.3.3 81 3/18/2024
0.3.2 72 3/18/2024
0.3.0 85 3/15/2024
0.2.6 85 3/15/2024
0.2.5 81 3/14/2024
0.2.3 269 1/2/2022
0.2.2 234 1/2/2022
0.2.1 234 1/2/2022
0.2.0 235 12/30/2021
0.1.0 284 8/30/2021