- if (tui.mode.has_input_prompt && event.key == 'Enter'
- && tui.inputEl.value.length == 0
- && ['chat', 'command_thing', 'take_thing', 'drop_thing',
- 'admin_enter'].includes(tui.mode.name)) {
- if (tui.mode.name != 'chat') {
+ if ((!tui.mode.is_intro && event.key == 'Escape')
+ || (tui.mode.has_input_prompt && event.key == 'Enter'
+ && tui.inputEl.value.length == 0
+ && ['chat', 'command_thing', 'take_thing', 'drop_thing',
+ 'admin_enter'].includes(tui.mode.name))) {
+ if (!['chat', 'play', 'study', 'edit'].includes(tui.mode.name)) {