Call timeouts before select or poll. Use do_cmdline_cmd instead of eval_to_string.