Handle ESC when in text box

Fixes #3.