make cursive
work with ncurses-rs
v6
#778
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
but first:
ncurses-rs
needs the changes in this PR: jeaye/ncurses-rs#218(technically only the ones in the last 3 commits of April 11th seen here)
However
pancurses
doesn't need these changes looks like, forcursive
to work with it, so0.17
seems good (butcursive
's examples are not tested with0.17
).The following were used successfully:
cargo build
cargo test
cargo build --all-features
cargo test --all-features
cargo build --all-targets
cargo test --all-targets
cargo build --all-targets --all-features
cargo test --all-targets --all-features
... on each of these target environments:
PKG_CONFIG_PATH
is set to the dir containingncurses.pc
file, or usednix-shell
command incursive
repo dir)libncurses-dev
)pkg-config
andpkgconf
installed.pkg-config
installed.LC_CTYPE=en_US.UTF-8
orLANG=en_US.UTF-8
to be set otherwise it looks as if it doesn't have wide chars support socursive
andpancuses
examples look pretty broken.TODO:
cargo test
) withpancurses
(dep)0.17
cargo test
) withpancurses
main
branch from github with this PR in.ncurses::newterm
call was ignored without alet _ =
before, in v5 too. If so, keep it untouched. It wasn't. No warnings with v5.cursive
need version bump in this PR? ie.version = "0.21.0"
or shall this be left to be done by the repo maintainer(s) ?!ncurses-rs
version inCargo.toml
after it gets published, ie. so it's not lower than that version, because then it would break compilation ofcursive
. Note thatpancurses
doesn't need a version bump (see above), although the examples I'm running are through the PR-edpancurses
only.pancurses
inCargo.toml
too, after it gets its PR for the v6ncurses-rs
usage.cargo test --example select_test -- --nocapture
in addition to the suggested--bin
which doesn't work.ncurses-rs
v6)warning: attribute should be applied to a foreign function or static
#[link_name="box"]
not a foreign function or static
, this is onncurses-rs
warning: unused
Resultthat must be used
, (for all 3 cases) happens due toCString::new
This function will return an error if the supplied bytes contain an internal 0 byte.
ncurses::newterm
.unwrap()
is safe here due to usingNone
as the first arg tonewterm
ncurses::mvaddstr
ncurses::addstr
\0
is encountered in the string: ignore, unwrap, rethrow(the?
aka try operator) then fix the warnings forncurses::mvaddstr
andncurses::addstr
above.print_at
with string that contains\0
in the middle.print_at_rep
with string that contains\0
in the middle.#[test]
for both because otherwise they'd interfere with each other during parallel testing, well maybe not unless--nocapture
is used. Well, let's just say I've had to runreset
to restore my terminal.cargo clippy
and fix:warning: this seems like a manual implementation of the non-exhaustive pattern
pub enum MouseButton
cargo test --features="ncurses-backend,ansi,toml"
cargo test --example select_test -- --nocapture