All Projects → waf → PrettyPrompt

waf / PrettyPrompt

Licence: MPL-2.0 License
A cross-platform command line prompt library that provides syntax highlighting, autocompletion, history and multi-line input.

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to PrettyPrompt

Hss
An interactive parallel ssh client featuring autocomplete and asynchronous execution.
Stars: ✭ 248 (+451.11%)
Mutual labels:  autocompletion, readline
Athenacli
AthenaCLI is a CLI tool for AWS Athena service that can do auto-completion and syntax highlighting.
Stars: ✭ 151 (+235.56%)
Mutual labels:  syntax-highlighting, autocompletion
Replxx
A readline and libedit replacement that supports UTF-8, syntax highlighting, hints and Windows and is BSD licensed.
Stars: ✭ 446 (+891.11%)
Mutual labels:  syntax-highlighting, readline
Readline Sync
Synchronous Readline for interactively running to have a conversation with the user via a console(TTY).
Stars: ✭ 601 (+1235.56%)
Mutual labels:  repl, readline
editor
A text editor written in Nim
Stars: ✭ 24 (-46.67%)
Mutual labels:  syntax-highlighting, autocompletion
Lua Resty Repl
Interactive console (REPL) for Openresty and luajit code
Stars: ✭ 165 (+266.67%)
Mutual labels:  repl, readline
Ide Stubs
Phalcon IDE Stubs
Stars: ✭ 137 (+204.44%)
Mutual labels:  syntax-highlighting, autocompletion
Jay
😎 Supercharged JavaScript REPL
Stars: ✭ 970 (+2055.56%)
Mutual labels:  repl, readline
fancyline
Readline-esque library with fancy features
Stars: ✭ 72 (+60%)
Mutual labels:  repl, readline
TheVimIDE
Modern Vim IDE with support for C/C++, Java, Python, Lua, PHP, JavaScript, Ruby and much more ...
Stars: ✭ 33 (-26.67%)
Mutual labels:  syntax-highlighting, autocompletion
Rdf.sh
A multi-tool shell script for doing Semantic Web jobs on the command line.
Stars: ✭ 109 (+142.22%)
Mutual labels:  syntax-highlighting, autocompletion
Clojure-Sublimed
Clojure support for Sublime Text 4
Stars: ✭ 268 (+495.56%)
Mutual labels:  syntax-highlighting, repl
Sublime-GameMaker-Studio-Language-Bundle
A sublime bundle for GameMaker Language (GML)
Stars: ✭ 32 (-28.89%)
Mutual labels:  syntax-highlighting, autocompletion
network tech
Cisco config syntax and snippets for Sublime Text
Stars: ✭ 82 (+82.22%)
Mutual labels:  syntax-highlighting, autocompletion
repline
Haskeline wrapper for GHCi-like REPL interfaces
Stars: ✭ 98 (+117.78%)
Mutual labels:  repl, readline
re-mote
Re-mote operations using SSH and Re-gent
Stars: ✭ 61 (+35.56%)
Mutual labels:  repl
vscode-ampscript
This extension allows you to connect Visual Studio Code directly to your MC Account, enables syntax highlighting for AMPScript, has built-in documentation for all AMPScript functions and also adds code snippets for language elements and functions.
Stars: ✭ 37 (-17.78%)
Mutual labels:  syntax-highlighting
yii2-autocomplete-helper
Yii2 IDE Autocomplete Helper
Stars: ✭ 38 (-15.56%)
Mutual labels:  autocompletion
core
🌈 light, fast, and easy to use, dependencies free javascript syntax highlighter, with automatic language detection
Stars: ✭ 40 (-11.11%)
Mutual labels:  syntax-highlighting
ghc-syntax-highlighter
Syntax highlighter for Haskell using the lexer of GHC
Stars: ✭ 55 (+22.22%)
Mutual labels:  syntax-highlighting

PrettyPrompt

Nuget Code Coverage Build Status

A cross-platform command line prompt that provides syntax highlighting, autocompletion, history and more! It's Console.ReadLine() on steroids.

PrettyPrompt screenshot

Features

  • User Experience (UX) features:
    • Syntax highlighting support via ANSI escape sequences. Supports both the terminal color palette and full RGB colors.
    • Autocompletion menu, with extended documentation tooltips
    • Multi-line input
    • Word-wrapping
    • History navigation, optionally persistent across sessions, with history filtering (similar to PSReadLine's HistorySearchBackward).
    • Unsurprising keybindings: Home, End, Ctrl-L to clear screen, Ctrl-C to cancel current line, Ctrl+Space to open autocomplete menu, and more.
    • Cross platform copy/paste: Ctrl-Shift-C for copy, Ctrl-V or Shift-Insert for pasting.
    • Works "in-line" on the command line; it doesn't take over the entire terminal window.
  • Developer Experience (DX) features:
    • Provides a CancellationToken for each prompt result, so the end-user of your application can cancel long running tasks via Ctrl-C.
    • Supports registering callbacks for key presses, to customize application behavior.
    • Optionally detects incomplete lines and converts Enter to a "soft newline" (Shift-Enter).
    • Fast rendering—PrettyPrompt only renders the diff of what changed, so the screen doesn't flicker as text is redrawn.

Installation

PrettyPrompt can be installed from nuget by running the following command:

dotnet add package PrettyPrompt

Usage

A simple read-eval-print-loop looks like this:

var prompt = new Prompt();

while (true)
{
    var response = await prompt.ReadLineAsync("> ");
    if (response.IsSuccess) // false if user cancels, i.e. ctrl-c
    {
        if (response.Text == "exit") break;

        Console.WriteLine("You wrote " + response.Text);
    }
}

The Prompt constructor takes optional configuration options for enabling syntax highlighting, autocompletion, and soft-newline configuration. For a more complete example, see the project in the examples directory. If you have the dotnet example global tool installed, run the following command in the repository root:

dotnet example FruitPrompt

Building from source

This application target .NET 5, and can be built with either Visual Studio or the normal dotnet build command line tool.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].