Added flags to prevent keys echoing on different terminals