diff options
author | Jesse Luehrs <doy@tozt.net> | 2021-03-13 17:16:24 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2021-03-13 17:16:24 -0500 |
commit | bbf648ce7a6eca59791171b0d51f1c2f7f8c507a (patch) | |
tree | c57fd585d5e84c5821c9d995900834786d68a953 /README.md | |
parent | 9bb3185998d3dcd047f6de0e34f018b37cfdb37c (diff) | |
download | textmode-bbf648ce7a6eca59791171b0d51f1c2f7f8c507a.tar.gz textmode-bbf648ce7a6eca59791171b0d51f1c2f7f8c507a.zip |
prep for initial releasev0.1.0
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/README.md b/README.md new file mode 100644 index 0000000..aff1aae --- /dev/null +++ b/README.md @@ -0,0 +1,30 @@ +# textmode + +`textmode` is a library for terminal interaction built on top of a real +terminal parsing library. It allows you to do arbitrary drawing operations on +an in-memory screen, and then update the visible terminal output to reflect the +in-memory screen via an optimized diff algorithm when you are finished. Being +built on a real terminal parsing library means that while normal curses-like +operations are available: + +```rust +use textmode::Textmode; +let mut tm = textmode::Output::new().await?; +tm.clear(); +tm.move_to(5, 5); +tm.set_fgcolor(textmode::color::RED); +tm.write_str("foo"); +tm.refresh().await?; +``` + +you can also write data containing arbitrary terminal escape codes to the +output and they will also do the right thing: + +```rust +tm.write(b"\x1b[34m\x1b[3;9Hbar\x1b[m"); +tm.refresh().await?; +``` + +This module is split into two main parts: `Output` and `Input`. See the +documentation for those types for more details. Additionally, the `blocking` +module provides an equivalent interface with blocking calls instead of async. |