From 9b2a97806ffff94c9568be2f1ecebdf1f61bd50b Mon Sep 17 00:00:00 2001 From: Piotr Pawel Stefaniak Date: Mon, 27 Jul 2020 18:46:20 +0000 Subject: [PATCH] sh(1): print a newline when ^D quits sh I've always found this a little bit confusing: > sh $ ^D> sh $ ^D> Reviewed by: 0mp, jilles MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25813 --- bin/sh/main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bin/sh/main.c b/bin/sh/main.c index 4d0aae96215f..8df24dba312e 100644 --- a/bin/sh/main.c +++ b/bin/sh/main.c @@ -228,6 +228,10 @@ cmdloop(int top) } } popstackmark(&smark); + if (top && iflag) { + out2c('\n'); + flushout(out2); + } }