Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ^\ handling with readline, without breaking ^D handling with readline. #116

Merged
merged 1 commit into from
Sep 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions input.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,13 @@ static char *callreadline(char *prompt) {
if (!setjmp(slowlabel)) {
slow = TRUE;
r = interrupted ? NULL : readline(prompt);
} else
if (interrupted)
errno = EINTR;
} else {
r = NULL;
slow = FALSE;
if (r == NULL)
errno = EINTR;
}
slow = FALSE;
SIGCHK();
return r;
}
Expand Down Expand Up @@ -298,9 +300,12 @@ static int fdfill(Input *in) {

#if READLINE
if (in->runflags & run_interactive && in->fd == 0) {
char *rlinebuf = callreadline(prompt);
if (rlinebuf == NULL)
char *rlinebuf = NULL;
do {
rlinebuf = callreadline(prompt);
} while (rlinebuf == NULL && errno == EINTR);

if (rlinebuf == NULL)
nread = 0;
else {
if (*rlinebuf != '\0')
Expand Down