From 3a34cf9cbffae162ac0727c02fa43c189cd0c454 Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Sun, 2 Apr 2023 12:17:49 -0400 Subject: fix ^C --- interactive.c | 4 ++++ shed_commands.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/interactive.c b/interactive.c index 545a52d..239c001 100644 --- a/interactive.c +++ b/interactive.c @@ -39,6 +39,10 @@ int sh_interactive(void) return 0; } + if (strlen(ed.cur->buf) == 0) { + continue; + } + struct command *command = sh_parse(ed.cur->buf); if (command) { sh_execute(command); diff --git a/shed_commands.c b/shed_commands.c index adf31ab..51b986b 100644 --- a/shed_commands.c +++ b/shed_commands.c @@ -30,7 +30,7 @@ int shed_backspace(struct shed *e) int shed_cancel(struct shed *e) { struct buffer *b = e->cur; - write(STDOUT_FILENO, "^C", 2); + write(STDOUT_FILENO, "^C\n", 3); b->nread = 0; return 0; } -- cgit v1.2.1