Shell: Handle keyboard input that was interrupted by signal

This commit is contained in:
Bananymous 2023-12-06 13:04:33 +02:00
parent 1c78671078
commit 56008869d6
1 changed files with 13 additions and 1 deletions

View File

@ -908,7 +908,19 @@ int main(int argc, char** argv)
while (true)
{
uint8_t ch = getchar();
int chi = getchar();
if (chi == EOF)
{
if (errno == EINTR)
{
clearerr(stdin);
continue;
}
perror("getchar");
return 1;
}
uint8_t ch = chi;
if (waiting_utf8 > 0)
{