Gracefully exit upon EOF

Taken from #94 - Originally fixed by dressupgeekout  and refined by joevt
This commit is contained in:
dingusdev 2024-06-16 07:28:40 -07:00
parent ce5edcb0c8
commit c0e28b81a8

View File

@ -530,6 +530,11 @@ void enter_debugger() {
continue;
}
if (feof(stdin)) {
printf("eof -> quit\n");
cmd = "quit";
}
cmd_repeat = cmd.empty() && !last_cmd.empty();
if (cmd_repeat) {
cmd = last_cmd;