Implemented a dirty hack, that allows "proper" handling of escape sequences. Thanks to that the user can now cancel input by pressing escape.