package main import ( "os" "os/signal" "syscall" "git.metznet.ca/MetzNet/go-ncurses" ) func main() { ncurses.SetLocale(0, "") input, input_active := ncurses.UTF8Listener(100, os.Stdin) os_sigs := make(chan os.Signal, 1) signal.Notify(os_sigs, syscall.SIGINT, syscall.SIGABRT) window := ncurses.InitScr() ret := ncurses.IdlOK(window, true) if ret != 0 { panic(ret) } ret = ncurses.ScrollOk(window, true) if ret != 0 { panic(ret) } ncurses.WRefresh(window) active := true for active { select { case bytes := <-input: ncurses.WAddStr(window, string(bytes)) ncurses.WRefresh(window) case <-os_sigs: active = false } } ncurses.EndWin() input_active.Store(false) close(input) }