From 47d6cc352e11130646220381820555eac47ba088 Mon Sep 17 00:00:00 2001 From: mirenn Date: Fri, 13 Mar 2026 16:25:39 +0100 Subject: added flag to suppress unimportat output --- src/linenoise/linenoise.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/linenoise/linenoise.c') diff --git a/src/linenoise/linenoise.c b/src/linenoise/linenoise.c index cfe51e7..57a6b7e 100644 --- a/src/linenoise/linenoise.c +++ b/src/linenoise/linenoise.c @@ -255,7 +255,9 @@ static int enableRawMode(int fd) { raw.c_cc[VMIN] = 1; raw.c_cc[VTIME] = 0; /* 1 byte, no timer */ /* put terminal in raw mode after flushing */ - if (tcsetattr(fd,TCSAFLUSH,&raw) < 0) goto fatal; + //if (tcsetattr(fd,TCSAFLUSH,&raw) < 0) goto fatal; + // https://github.com/antirez/linenoise/issues/43 + if (tcsetattr(fd,TCSADRAIN,&raw) < 0) goto fatal; rawmode = 1; return 0; @@ -266,7 +268,9 @@ fatal: static void disableRawMode(int fd) { /* Don't even check the return value as it's too late. */ - if (rawmode && tcsetattr(fd,TCSAFLUSH,&orig_termios) != -1) + // if (rawmode && tcsetattr(fd,TCSAFLUSH,&orig_termios) != -1) + // https://github.com/antirez/linenoise/issues/43 + if (rawmode && tcsetattr(fd,TCSADRAIN,&orig_termios) != -1) rawmode = 0; } -- cgit v1.2.3