diff --git a/src/input_handler.cc b/src/input_handler.cc index be4aa51f..1bd5a988 100644 --- a/src/input_handler.cc +++ b/src/input_handler.cc @@ -293,11 +293,13 @@ public: } else if (key == Key{Key::Modifiers::Control, 'm'}) // enter { - std::vector::iterator it; - while ((it = find(history, line)) != history.end()) - history.erase(it); - - history.push_back(line); + if (not line.empty()) + { + std::vector::iterator it; + while ((it = find(history, line)) != history.end()) + history.erase(it); + history.push_back(line); + } context().ui().print_status(""); context().ui().menu_hide(); reset_normal_mode();