Git Product home page Git Product logo

interactivereadline's People

Contributors

mattj23 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

interactivereadline's Issues

Create composable regex-based lexer

Create a default lexer which allows a user to add regex expressions in for tokens. The regexes should be addable through a fluent-like interface, returning a Func<LineState, TokenizedLine>.

The same lexing engine should be used as the existing example lexer that splits on whitespace. The user should have the option to add an integer to identify token type, which will be accessible through the IToken inteface.

Implement readline keys

The https://github.com/tonerdo/readline library has a set of keyboard shortcuts based on the old GNU Readline.

Right now only a few of them are implemented, the rest of them should be added as common behaviors and either added to the ReadLineConfig.Basic config, or another slightly elevated configuration.

Unify Key Behaviors

Right now there are special key behaviors, which are registered to a configuration, and the default key behaviors (insert character, enter) which are hard coded.

Replace the hard coded behaviors to use the same mechanism as the special behaviors, which will allow the behavior system to be modified in absolutely any way possible.

Create a default key behavior configuration which provides a normal, working console, and an empty configuration which has absolutely nothing and can be configured in any way.

Write method is extremely slow in some linux terminals

The default Ubuntu terminal is extremely slow when rewriting the entire line of text (xterm, on the other hand, is not). It seems likely that it has to do with writing text character by character to the System.Console, and that if larger sections of text could be written at once it might speed up.

There has historically been a known issue with reading the cursor position from the terminal on non-windows consoles.

Implement History

The last major feature missing for parity with other readline style libraries is the command history, navigable with the up and down arrow keys.

Some thought will need to be spent on figuring out where the history should be saved to and how it should be passed back out of the handler. Attaching the history to the configuration object seems like the most likely candidate, but it shouldn't be taken for granted that it's the correct choice.

Test Coverage

Right now unit tests are missing some important areas. Key behaviors, lexing, and the input handler and ConsoleReadLine objects are all problem areas which need to be covered by tests.

Better demo project

The demo project is currently just a test area, and should be made to be a more useful display of the library.

It should showcase:

  1. The composable key behavior system
  2. The lexing system
  3. The autocomplete system
  4. Formatting
  5. The history

Rename WriteMessage

The WriteMessage method is too specific, the method itself is more general. Rename it to something that actually makes sense.

It exists in IKeyBehaviorTarget, InputHandler, and IReadLine

Rename/refactor objects and interfaces

Many of the interfaces and objects names have remained fixed even as the API has evolved, meaning that the names don't necessarily reflect the elements and their purpose. Rethink the naming and fix where it makes sense.

Candidates for renaming:

  • IReadLine
  • InputHandler
  • ReadLineConfig
  • IConsoleWrapper

Color formatting

Finish the implementation of the foreground/background color writing to the System.Console.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.