fix prompt hang when hosted inside emacs