diff --git a/Shell/LineEditor.cpp b/Shell/LineEditor.cpp index ebfaf10150..053c6230d9 100644 --- a/Shell/LineEditor.cpp +++ b/Shell/LineEditor.cpp @@ -302,6 +302,13 @@ String LineEditor::get_line(const String& prompt) } continue; } + if (ch == g.termios.c_cc[VEOF]) { // Normally ^D + if (m_buffer.is_empty()) { + printf("\n"); + exit(0); + } + continue; + } if (ch == 0x05) { // ^E if (m_cursor < m_buffer.size()) { printf("\033[%dC", m_buffer.size() - m_cursor);