Improve prompt handling

As a long time vi user I find it highly irritating that
you cannot backspace out of the command prompt.
This commit is contained in:
Markus F.X.J. Oberhumer 2021-04-27 13:07:06 +02:00
parent e04cc1b4c8
commit e57fe4fb90

View File

@ -807,7 +807,8 @@ public:
m_callback(line, PromptEvent::Validate, context()); m_callback(line, PromptEvent::Validate, context());
return; return;
} }
else if (key == Key::Escape or key == ctrl('c')) else if (key == Key::Escape or key == ctrl('c') or
((key == Key::Backspace or key == ctrl('h')) and line.empty()))
{ {
history_push(line); history_push(line);
context().print_status(DisplayLine{}); context().print_status(DisplayLine{});