summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--interactive.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/interactive.c b/interactive.c
index 3f753a3..545a52d 100644
--- a/interactive.c
+++ b/interactive.c
@@ -34,6 +34,11 @@ int sh_interactive(void)
};
while (shed(&ed) != NULL) {
+ if (ed.cur->nread == 1 && ed.cur->buf[0] == CTRL_D) {
+ printf("\n");
+ return 0;
+ }
+
struct command *command = sh_parse(ed.cur->buf);
if (command) {
sh_execute(command);