From 3d912d0e4d85985f0ed36dcd66d64a203d3148fa Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Sun, 24 Nov 2019 21:40:12 -0500 Subject: [PATCH] fixed point handling with username and password inputs --- src/lib/xpty.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/lib/xpty.c b/src/lib/xpty.c index 922a8c0..ef3c049 100644 --- a/src/lib/xpty.c +++ b/src/lib/xpty.c @@ -100,14 +100,18 @@ static void putb(int byte) { char b = byte; write(Pty_Fd, &b, 1); - if (byte != '\n') + if (byte == '\n') + { + *((char*)(EditView->buffer.contents.gapstart-1)) = ' '; + EditView->buffer.point.beg = EditView->buffer.point.end; + } + else if ((tio.c_lflag & ECHO) != ECHO) { *((char*)(EditView->buffer.contents.gapstart-1)) = '*'; } else { - *((char*)(EditView->buffer.contents.gapstart-1)) = ' '; - EditView->buffer.point.beg = EditView->buffer.point.end; + read(Pty_Fd, &b, 1); } } else if (byte == '\n' && buf_inpoint(&(EditView->buffer), EditView->buffer.selection.end-1)) -- 2.54.0