Skip to content

Commit

Permalink
Defaults to crossterm backend
Browse files Browse the repository at this point in the history
  • Loading branch information
gyscos committed Jul 1, 2024
1 parent 5c277e4 commit 7c676b2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
[![Gitter chat](https://badges.gitter.im/gyscos/cursive.png)](https://gitter.im/cursive-rs/cursive)


Cursive is a TUI (Text User Interface) library for rust. It uses ncurses by default, but [other backends are available](https://github.com/gyscos/cursive/wiki/Backends).
Cursive is a TUI (Text User Interface) library for rust. It uses the [`crossterm`] backend by default, but [other backends are available](https://github.com/gyscos/cursive/wiki/Backends).

It allows you to build rich user interfaces for terminal applications.

[`crossterm`]: https://github.com/crossterm-rs/crossterm

# [Documentation](http://docs.rs/cursive)

It is designed to be safe and easy to use:
Expand All @@ -26,8 +28,6 @@ Or to use the latest git version:
cursive = { git = "https://github.com/gyscos/cursive" }
```

([You will also need ncurses installed.](https://github.com/gyscos/cursive/wiki/Install-ncurses))

```rust,no_run
use cursive::views::{Dialog, TextView};
Expand Down
2 changes: 1 addition & 1 deletion cursive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ version = "0.27"
doc-cfg = ["cursive_core/doc-cfg"] # Enable doc_cfg, a nightly-only doc feature.
builder = ["cursive_core/builder"]
blt-backend = ["bear-lib-terminal"]
default = ["ncurses-backend"]
default = ["crossterm-backend"]
ncurses-backend = ["ncurses", "maplit"]
pancurses-backend = ["pancurses", "maplit"]
termion-backend = ["termion"]
Expand Down
4 changes: 2 additions & 2 deletions cursive/src/backends/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ pub fn try_default() -> Result<Box<dyn cursive_core::backend::Backend>, Box<dyn
Ok(blt::Backend::init())
} else if #[cfg(feature = "termion-backend")] {
termion::Backend::init().map_err(boxed)
} else if #[cfg(feature = "crossterm-backend")] {
crossterm::Backend::init().map_err(boxed)
} else if #[cfg(feature = "pancurses-backend")] {
curses::pan::Backend::init().map_err(boxed)
} else if #[cfg(feature = "ncurses-backend")] {
curses::n::Backend::init().map_err(boxed)
} else if #[cfg(feature = "crossterm-backend")] {
crossterm::Backend::init().map_err(boxed)
} else {
log::warn!("No built-it backend, falling back to Dummy backend.");
Ok(cursive_core::backend::Dummy::init())
Expand Down
4 changes: 2 additions & 2 deletions cursive/src/cursive_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ impl CursiveExt for cursive_core::Cursive {
self.run_blt()
} else if #[cfg(feature = "termion-backend")] {
self.run_termion().unwrap()
} else if #[cfg(feature = "crossterm-backend")] {
self.run_crossterm().unwrap()
} else if #[cfg(feature = "pancurses-backend")] {
self.run_pancurses().unwrap()
} else if #[cfg(feature = "ncurses-backend")] {
self.run_ncurses().unwrap()
} else if #[cfg(feature = "crossterm-backend")] {
self.run_crossterm().unwrap()
} else {
log::warn!("No built-it backend, falling back to Cursive::dummy().");
self.run_dummy()
Expand Down

0 comments on commit 7c676b2

Please sign in to comment.