0 branches
Tree
Top files
Clone with HTTPS:
ncurses
Thin bindings for the system ncurses or curses library.
Supported targets:
- macOS
- Linux
- BSD and Solaris targets that provide a compatible curses library
- Windows currently reports
ncurses.is_supported() == falseMost functions returnncurses.okon success andncurses.erron failure.getch()andwgetch()return anint. Compare special keys withncurses.key_*.
Useimport ncurses fn main() { if !ncurses.is_supported() { return } stdscr := ncurses.initscr() defer { ncurses.endwin() } ncurses.cbreak() ncurses.noecho() ncurses.keypad(stdscr, true) ncurses.addstr('Press a key...') ncurses.refresh() key := ncurses.getch() ncurses.mvaddstr(1, 0, 'Key code: ${key}') ncurses.refresh() ncurses.getch() }newwin,box,waddstr,wrefresh, andwgetchfor additional windows. Usestart_color,init_pair, andcolor_pairfor color attributes.