ncursesThin bindings for the system ncurses or curses library.
Supported targets:
ncurses.is_supported() == falseMost functions return ncurses.ok on success and ncurses.err on failure.
getch() and wgetch() return an int. Compare special keys with
ncurses.key_*.import 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()
}
Use newwin, box, waddstr, wrefresh, and wgetch for additional windows.
Use start_color, init_pair, and color_pair for color attributes.