qwandor / anes-rs Goto Github PK
View Code? Open in Web Editor NEWANSI Escape Sequence provider & parser
Home Page: https://crates.io/crates/anes
License: Apache License 2.0
ANSI Escape Sequence provider & parser
Home Page: https://crates.io/crates/anes
License: Apache License 2.0
Understandably, emitting escape sequences to generate terminal mouse sequences is rather niche, but is it within the scope of this project? I'm thinking of using it as part of a terminal multiplexer for forwarding mouse events to pseudoterminals.
Version 0.1.6 provides:
pub enum Sequence {
Key(KeyCode, KeyModifiers),
Mouse(Mouse, KeyModifiers),
CursorPosition(u16, u16),
}
Parser
throws away every csi/esc sequence without known meaning (valid sequence, but we have no idea what it is). What's the problem. Any sequence, which isn't supported by anes
is trashed and crate user doesn't even know it. Is this something we should expose? Should we add Sequence::UnknownEsc(char)
& Sequence::UnknownCsi(Vec<u64>, usize, char)
?
I want to use anes for Arduino serial I/O, but cannot, because it requires std. Can we make a no_std version of anes, or it's better to fork it?
Version 0.1.6 hides the State
, Engine
& Provide
types. Basically the whole src/parser/engine.rs
content.
anes-parser
crate for example?While the License is documented on crates.io, many distros (e.g. Fedora) want an actual file as part of the package. Lawyers are very pedantic.
We parse all the input as u8
slice in the crossterm
crate. It means that we are just matching byte sequences, but we don't know if the CSI sequence is (in)valid and thus we don't know if we should stop, start new sequence, etc.
Implement a two step parser:
You can check #15 where this kind of parser is being developed. It's gated with the parser
feature.
error[E0432]: unresolved import `anes::parser`
--> examples/parser.rs:6:5
|
6 | parser::{KeyCode, Parser, Sequence},
| ^^^^^^ could not find `parser` in `anes`
For more information about this error, try `rustc --explain E0432`.
error: could not compile `anes` due to previous error
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.