vlang / v

Simple, fast, safe, compiled language for developing maintainable software. Compiles itself in <1s with zero library dependencies. Supports automatic C => V translation. https://vlang.io
MIT License
35.54k stars 2.14k forks source link

Add a ncurses library #21588

Open Jeremy-JYL opened 1 month ago

Jeremy-JYL commented 1 month ago

Describe the feature

I want the standed ncurses function like getch, initscr and ETC

Use Case

I want to make a command line interface and the internal term.ui library didn't have many function for example getch.

Proposed Solution

Create a library that have the ncurses C binding. Note: I actually stuck here because I don't know what will ncurses's function return.

Other Information

No response

Acknowledgements

Version used

V 0.4.6 80397e6, timestamp: 2024-05-27 23:06:52 +0300

Environment details (OS name and version, etc.)

MacOs 14.1.1

[!NOTE] You can use the 👍 reaction to increase the issue's priority for developers.

Please note that only the 👍 reaction to the issue itself counts as a vote. Other reactions and those to comments will not be taken into account.

JalonSolov commented 1 month ago

The regular term module (not term.ui) has functions as well, such as https://modules.vlang.io/term.html#utf8_getchar

spytheman commented 1 month ago

ncurses does not have windows implementation afaik

Delta456 commented 1 month ago

I believe anyone from the community can make the bindings.

Jeremy-JYL commented 1 month ago

ncurses does not have windows implementation afaik

But the python3 have it working, according to the python docs Windows use something called UniCurses

JalonSolov commented 1 month ago

According to the UniCurses page, it is a Python wrapper around PDCurses lib... neither of which is native to Windows (as in, it doesn't come with the OS).

Jeremy-JYL commented 1 month ago

According to the UniCurses page, it is a Python wrapper around PDCurses lib... neither of which is native to Windows (as in, it doesn't come with the OS).

But maybe someone can make a module and when installing the module, it auto detect the os and install the correct deps.

JalonSolov commented 1 month ago

Perhaps someone could, if they wanted to do so.

LifeCANvs commented 1 month ago

How about using https://github.com/Bill-Gray/PDCursesMod ?

And maybe https://github.com/dankamongmen/notcurses ?