Skip to content

v0.0.7

Latest

Choose a tag to compare

@github-actions github-actions released this 11 Oct 19:12
· 1 commit to main since this release

uncurses is a Rust library for building terminal user interfaces. It gives you a direct, framework-free way to draw to the terminal and read input — you own every cell and your own event loop, whether you run inline, take over the full screen, or mix the two.

A diffing renderer that redraws only what changed, Unicode-aware width, truecolor styling with automatic downsampling, hyperlinks, and typed keyboard, mouse, and paste input. It asks the terminal what it supports instead of looking it up in a terminfo database, so the same code runs on Linux, macOS, and Windows.

[dependencies]
uncurses = "0.0.7"

Using ratatui? uncurses-ratatui provides a backend.

Guides, concepts, and API reference: uncurses.org

Highlights

  • OSC 7501 revision 0.4 query replies with accepted state and kind names.
  • Extensible report names through distinct borrowed string types.
  • One program-status capability accessor for support and accepted names.

Both uncurses and uncurses-ratatui use version 0.0.7.
The adapter has no independent API changes in this release.

Migrate from v0.0.6

This release changes the program-status API introduced in v0.0.6.

Query replies and capabilities

Replace Event::ProgramStatusSupported with Event::ProgramStatus(report).
The event::ProgramStatusCapabilities payload owns two public lists:
report.states and report.kinds.

Capabilities::program_status() returns Option<&ProgramStatusCapabilities>
instead of bool. Use .is_some() for a support check.
Use the returned payload to read accepted names.

None means support remains unconfirmed. A reply confirms support even
when both lists are empty. Absent reply fields use the fixed protocol
defaults. Explicit empty lists stay empty, and extension names remain intact.

Report state and kind names

ProgramStatusState<'a> and ProgramStatusKind<'a> are borrowed string
types with associated constants. Replace the former enum variants:

v0.0.6 v0.0.7
ProgramStatusState::Idle ProgramStatusState::IDLE
ProgramStatusState::Working ProgramStatusState::WORKING
ProgramStatusState::Done ProgramStatusState::DONE
ProgramStatusState::Blocked ProgramStatusState::BLOCKED
ProgramStatusState::Error ProgramStatusState::ERROR
ProgramStatusState::Clear ProgramStatusState::CLEAR
ProgramStatusKind::Permission ProgramStatusKind::PERMISSION
ProgramStatusKind::Question ProgramStatusKind::QUESTION
ProgramStatusKind::Auth ProgramStatusKind::AUTH

Use new(name) for extension names and as_str() to read their wire values.
Add a lifetime parameter where stored state or kind types require one.
Use a fallback arm in matches to handle extension names.
Equal names compare and hash equally, whether constructed or supplied by a constant.

Constructors borrow names. The writer validates them before output.
Names must be nonempty and use the protocol's value alphabet.
The complete encoded report must fit within 4096 bytes.
Commas are valid report bytes, but query replies interpret them as list separators.
Check terminal support before you use an extension.

Unchanged behavior

Program reports still flush immediately. Queries remain optional and explicit.
The terminal owns record lifetime; pause, resume, and finish leave records intact.

The program_status example demonstrates queries and extension names.
Its four standard report sequences remain unchanged.
Its output adds an escaped custom-name preview line.

See the program status guide
and protocol specification.

Changelog

Breaking changes

  • Support extensible OSC 7501 status names (#90)