Installation

uncurses is pure Rust with a tiny dependency footprint. Add it, keep the default width backend or pick another one, and you are ready to draw.

Add the dependency

Install v0.0.9 of uncurses and uncurses-ratatui from crates.io. Use the matching API reference: uncurses v0.0.9 or uncurses-ratatui v0.0.9.

The dependency examples on this page target v0.0.9:

toml
[dependencies]
uncurses = "0.0.9"

Using the Ratatui backend too? Add the core crate, the backend crate, and Ratatui:

toml
[dependencies]
uncurses = "0.0.9"
uncurses-ratatui = "0.0.9"
ratatui = "0.30"

The rest of this website follows the current repository source. For unreleased APIs, use matching git dependencies from the repository.

Feature flags

Every app needs a width backend, since terminal layout is measured in cells and some characters are two cells wide. uncurses ships two, and you pick one.

FeatureDefaultWhat it does
unicode-rsyesPure-Rust width and segmentation tables. Small build, conservative on emoji and zero-width-joiner edge cases.
icunoICU4X-backed segmentation and Unicode properties. Strictly more correct on the tricky clusters, at the cost of a larger binary. Wins when both are on.
asyncnoAdds EventStream, a runtime-agnostic futures_core::Stream of decoded events. Pulls in only futures-core, no executor.

The default is unicode-rs. If you turn default features off, choose unicode-rs or icu; building without a width backend fails. To trade size for correctness, switch to icu:

toml
[dependencies]
uncurses = { version = "0.0.9", default-features = false, features = ["icu"] }

To await events instead of blocking a thread, add async:

toml
[dependencies]
uncurses = { version = "0.0.9", features = ["async"] }

Supported platforms

CI covers Linux (glibc and musl), macOS, Windows, FreeBSD, OpenBSD, NetBSD, illumos, and Solaris. uncurses does not use terminfo and assumes a modern, VT100/xterm-compatible terminal, so there is no platform database to install and no per-terminal configuration to manage.

Rust version

uncurses uses the 2024 edition, currently needs Rust 1.88 or newer, and tracks the latest stable toolchain. There is no separate toolchain or build step: a normal cargo build is all it takes.

Next steps

With the crate added, the next page writes the smallest complete interactive program: Hello, terminal.

The uncurses skill helps coding assistants write uncurses applications and find relevant examples.

Edit this page

Search documentation

Type to search the documentation.