code: func Close() {
  	quit <- 1
  	out.WriteString(funcs[t_show_cursor])
  	out.WriteString(funcs[t_sgr0])
  	out.WriteString(funcs[t_clear_screen])
  	out.WriteString(funcs[t_exit_ca])
  	out.WriteString(funcs[t_exit_keypad])
  	out.WriteString(funcs[t_exit_mouse])
  	tcsetattr(out.Fd(), &orig_tios)
  
  	out.Close()
  	syscall.Close(in)
  
  	// reset the state, so that on next Init() it will work again
  	termw = 0
  	termh = 0
  	input_mode = InputEsc
  	out = nil
  	in = 0
  	lastfg = attr_invalid
  	lastbg = attr_invalid
  	lastx = coord_invalid
  	lasty = coord_invalid
  	cursor_x = cursor_hidden
  	cursor_y = cursor_hidden
  	foreground = ColorDefault
  	background = ColorDefault
  	IsInit = false
  }
docs: // Finalizes termbox library, should be called after successful initialization
  // when termbox's functionality isn't required anymore.