mattj23 / interactivereadline Goto Github PK
View Code? Open in Web Editor NEWSpecial console readline intended for interactive console applications or cli-like UI widgets
License: MIT License
Special console readline intended for interactive console applications or cli-like UI widgets
License: MIT License
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.
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.
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.
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.
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.
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.
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:
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
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:
Finish the implementation of the foreground/background color writing to the System.Console
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.