Skip to content
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

NCurses should perhaps be a separate package #20

Open
jmichel7 opened this issue Nov 21, 2024 · 6 comments
Open

NCurses should perhaps be a separate package #20

jmichel7 opened this issue Nov 21, 2024 · 6 comments

Comments

@jmichel7
Copy link
Contributor

It seems to me that the submodule NCurses would see more uses and have more developers if it was a separate package from TextUserInterfaces. I would be willing to help do that and write documentation for the resulting package if you agree it is a reasonable idea. There is one thing glaringly missing, the constant stdscr. I do not know if it is possible to give a reference to something in libncurses, but it is always possible to have in the package a global constant

stdscr::Ptr{WINDOW}=0

and since stdscr is the result of initscr, a way would be to rename the current initscr to _initscr and have

function initscr()
  NCurses.load_ncurses()
  global stdscr=_initscr()
  stdscr
end
@ronisbr
Copy link
Owner

ronisbr commented Nov 26, 2024

Hi @jmichel7 !

I completely agree. If you can split this module, it would be awesome! I am having almost no time to develop this package. However, it will be ready one day. I will keep using this submodule just because of the lack of time but when the pacakge is ready for usage, I will switch to yours.

Thanks!

@jmichel7
Copy link
Contributor Author

Thank you for pulling my changes! I will think of making an Ncurses package if you have time to do something about my other issues. In the mean time, could you register (parhaps as version 0.0.2) the current state of TextUserInterfaces? It is not very convenient to depend on an unregistered package.

Thank you again for your work!

@ronisbr
Copy link
Owner

ronisbr commented Nov 26, 2024

Sure! I will try to fix and update the version.

@jmichel7
Copy link
Contributor Author

Thinking of making a separate ncurses package, I looked in juliahub and found:

  • there is an old (no patches for 11 years) non-functional NCurses.jl by Keno.
  • there is a new Ncurses.jl by eschnett. This package was not registered when I started work on my package Vdiff three months ago. I tried this package today and managed to use it but it needed a lot of fixes:
  • it does not have any function using implicitly stdscr
    (like getch instead of wgetch, etc...)
  • it does not have any function whose name starts by mv

Of course you can define these functions in term of others, but still this is a pain.

  • the definition of acs characters is buggy and does not work (I had to copy yours)
  • getmouse cannot work because MEVENT is not mutable.
  • there is not any helpstrings; one misses your nice help on prototypes.

So I still wish to make a separate package from your code, but the situation
is more complicated: natural names for the package are not available.

What do you think?

@ronisbr
Copy link
Owner

ronisbr commented Dec 3, 2024

Maybe can you contact Keno to check if he can transfer the NCurses.jl repository to you? This is probably the best action.

Never mind. The registered repository is not the one created by Keno.

So, there is two possibilities: 1) check if eschnett accepts a PR to make NCurses.jl more close to our submodule, or 2) create a new repository with another name.

@jmichel7
Copy link
Contributor Author

jmichel7 commented Dec 3, 2024

It would be much more work to make Eschnett's repository closer to yours (there is nothing like your prototypes). The
NCurses package of Keno (which is not the same as the Ncurses package of Eschnett) seems to be dead. So you could ask him if you could become a committer (you are more known than me in the Julia community). You can also add me as a committer so I can do the work...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants