]> git.mdlowis.com Git - projs/tide.git/commitdiff
fixed point handling with username and password inputs
authorMichael D. Lowis <mike@mdlowis.com>
Mon, 25 Nov 2019 02:40:12 +0000 (21:40 -0500)
committerMichael D. Lowis <mike@mdlowis.com>
Mon, 25 Nov 2019 02:40:12 +0000 (21:40 -0500)
src/lib/xpty.c

index 922a8c0406e75308cf33b8ff0f76e405756b873d..ef3c0493ab337b6c400b3bdc7284e7074df1b096 100644 (file)
@@ -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))