gyscos / gyscos/cursive

[FEATURE] Support for manual backend initialization/deinitialization

Open
#659 0 comments 2 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
4.8k
Forks
270
Avg merge
5d 19h
Merged PRs (30d)
2

Description

This is more or less essential in utilities that invoke interactive commands. My proposal is to add two new methods to `Cursive`: `stop()` and `resume()`. `stop()` would de-initialize the backend (i.e. disable raw mode, show cursor leave alternate screen etc) and make the event loop noop (the same as if it were running with `backend::Dummy`) until `resume()` is called. `resume()` would initialize the backend and restore the event loop. This is useful in the case you need to invoke an interactive command (eg. `fdisk`) from a callback in a `View`. Currently, the only way to do this is to manually run the de-initialization part of `Backend::drop`, invoke the command and finally run the initialization code from `Backend::init()`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.