-
Notifications
You must be signed in to change notification settings - Fork 249
Backends
To actually interface with the terminal, Cursive uses a backend library. While this currently defaults to ncurses-rs, a few other backends are available and can be enabled with cargo features.
-
ncurses
(default): uses the ncurses-rs library directly. Currently only compatible on Linux and macOS. -
pancurses
: uses the pancurses library, which forwards calls to ncurses-rs on Linux/macOS or pdcurses-sys on Windows. -
bear-lib-terminal
: uses the cross-platform BearLibTerminal.rs binding. Works on Linux and Windows.Note: BearLibTerminal is a graphical application emulating a terminal. There is an archlinux package, or you can download a release.
-
termion
: uses the pure-rust termion library. Still in heavy development. Works on Linux and macOS.
To use a different backend, you will have to disable the default features and enable the desired backend feature.
To run an example from the cursive source code, you can run:
cargo run -v --no-default-features --features pancurses --example select
To select a specific backend in your application:
# Cargo.toml
[dependencies.cursive]
version = "0.3"
default-features = false
features = ["bear-lib-terminal"]
Or you can leave the choice to compilation time, forwarding cursive's features to your own application:
# Cargo.toml
[dependency.cursive]
version = "0.3"
default-features = false
[features]
default = ["ncurses"]
ncurses = ["cursive/ncurses"]
pancurses = ["cursive/pancurses"]
termion = ["cursive/termion"]
bear-lib-terminal = ["cursive/bear-lib-terminal"]