diff options
Diffstat (limited to 'src/user/driver')
-rw-r--r-- | src/user/driver/termcook.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/user/driver/termcook.c b/src/user/driver/termcook.c index 6ed8223..56ac77c 100644 --- a/src/user/driver/termcook.c +++ b/src/user/driver/termcook.c @@ -28,8 +28,12 @@ static void line_editor(handle_t input, handle_t output) { } break; case 4: /* EOT, C-d */ - w_output(output, linebuf, linepos); - linepos = 0; + if (linepos > 0) { + w_output(output, linebuf, linepos); + linepos = 0; + } else { + _syscall_write(output, NULL, 0, 0); // eof + } break; case '\n': case '\r': |