Giter Club home page Giter Club logo

easycurses-rs's Introduction

License:Unlicense CratesIO Travis-ci Appveyor

EasyCurses

A rust crate to smooth over the pain points of working with curses. Because it's based on pancurses, it works equally well with on both windows and unix computers.

Examples are available in the examples/ directory. The files are somewhat commented, and you can run any of them with cargo to see them in action.

cargo run --example <fileName>

Full API documentation available at docs.rs/easycurses

Terminal Safety

Normally when you're using curses there's a big danger that your program will leave the terminal in an unusable state where things don't print properly and stuff if your program exits on accident and you don't get your chance to call endwin properly. EasyCurses will safely cleanup the terminal and restore it to a useable state when your program closes via its Drop trait. No worries.

The catch is that you do have to only ever have one EasyCurses value active at once. Having two at once would let the initialization and shutdown get out of balance, and things would go bad. This is tracked with an AtomicBool value that's flipped on and off as appropriate.

Similarly, if you ever abort the program entirely there's no chance for cleanup, since an abort is an instant termination of the process. So, just don't ever compile with panic=abort, or use exit, or panic during an unwind, or anything else like that. At least not while an EasyCurses value is in scope somewhere within your call stack.

Stability

I would characterize the library as "largely stable". As laid out somewhere during the 1.0-level crate discussions, a crate can't rightly call itself 1.0 unless all the things it depends on are themselves 1.0, so no matter what this crate won't actually go to 1.0 before pancurses does.

License

This project is released into the public domain via The Unlicense. You are free to use it however you like with or without attribution. If you wish to contribute to the project then you must add your contributions under the same license.

easycurses-rs's People

Contributors

kore-signet avatar lokathor avatar spearman avatar

Watchers

 avatar

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.