#include <stdlib.h>
#include <stdio.h>
#include <string.h>
+#include <errno.h>
#define STDIN_FD 0
#define STDOUT_FD 1
}
// Return NULL when command is still being edited
+ errno = EAGAIN;
return NULL;
}
struct ptymode mode = {.InputMode = 0, .OutputMode = 0};
_SysIOCtl(STDIN_FD, PTY_IOCTL_SETMODE, &mode);
- while( NULL == (ret = Readline_NonBlock(Info)) );
+ while( NULL == (ret = Readline_NonBlock(Info)) && errno == EAGAIN );
// stty +echo,canon
mode.InputMode = PTYIMODE_CANON|PTYIMODE_ECHO;