-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make pancurses
work with ncurses
6.0.1
#93
base: main
Are you sure you want to change the base?
Conversation
aa64a45
to
27ec419
Compare
pancurses
work with ncurses-rs
v6
Thanks for the PR. I'll look through this as soon as I find a bit of time. |
No worries, it's still in draft phase until the |
This comment was marked as outdated.
This comment was marked as outdated.
Reopening because jeaye/ncurses-rs#220 got in, so this PR might work now, bare with me while I re-test everything in OP... |
pancurses
work with ncurses-rs
v6pancurses
work with ncurses
6.0.1
... created due to using -Z treat-err-as-bug=5 and there are more than 5 compile errors, eg. rustc-ice-2024-04-11T10_19_07-85702.txt
27ec419
to
91c83d6
Compare
I forgot that I had deleted the virtual machines, so testing was now only done on Gentoo... but otherwise the PR is ready. Note that the EDIT: technically only this 1 of the 3 commits is needed. Can cherry-pick it, or tell me whether or not to remove the other 2 and force-push ? |
but first,ncurses-rs
needs the changes in this PR : jeaye/ncurses-rs#220 (but the below were tested only with PR jeaye/ncurses-rs#218 which is a superset PR which handles more error cases/warnings and overall improves build, I'll have to retest depending on which PR, if ever, gets merged)this got in jeaye/ncurses-rs#220 as v6.0.1 (already on
crates.io
), so I'm testing with this version.Note:
KEY_EVENT
went away, though it wasn't used anywhere inpancurses
.Closes #92
cargo test
cargo run --example
...cargo run --example newtest
, has text under the color box, was it the same with v5 ? yes, it was, overlayed the screens look identical on v5 and on v6 now.cargo run --example newtest
only shows the correct text in the other languages on NixOS, this appears to be due toncursesw
being selected there bypkg-config
for some reason, not on Fedora/Gentoo which selectncurses
- and I didn't force with any features likewide
(if I do, it works on those 2 also: ie.cargo run --example newtest --features wide
)mvprintw
andprintw
bypancurses
were using formatting before, since they can't anymore in v6. Ok, it wasn't possible to use formatting before, due to no extra args could've been supplied to fulfill the requested formatting; this got fixed inncurses-rs
so that the unformatted string that was used(as the only arg) won't segfault anymore if%
was in it.cargo test
wide
show_menu
disable_resize
Legend:
The above are checked to be true on:
PKG_CONFIG_PATH
is set to the dir containingncurses.pc
file)--all-features
because thenwin32
andwin32a
will both be used and fail compilation)TERM=xterm-256color
but are broken withTERM=xterm
, via ssh usingalacritty
terminal (freebsd doesn't havealacritty
in term database, so had to change it to can compilencurses-rs
aka ncurses crate).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:
pancurses
to reflect these changes,0.18
? (or leave this to the repo owner to do)ncurses-rs
version inCargo.toml
after it gets published, ie. so it's not lower than that version, because then it would break compilation ofpancurses
cargo clippy
and fix:error: this public function might dereference a raw pointer but is not marked unsafe
unsafe { curses::delscreen(screen) }
unsafe { curses::newterm(type_ptr, output, input) }
unsafe { curses::newterm(type_ptr, output, input) }
unsafe { curses::set_term(new) }
-Z treat-err-as-bug=5
warning: name
FILEcontains a capitalized acronym