Poll the uvar notifier when the reader is interrupted by a signal

While the user waits at the prompt, fish is waiting in select(), on stdin.
The sigio based universal notifier interrupts select() by arranging for a
signal to be delivered, which causes select() to return with EINTR.
However we weren't polling the notifier at that point so we would not
notice uvar changes, until we got some real input.

I didn't notice this when testing, because my testing was changing fish
prompt colors which updated the prompt for other reasons.

Fixes #7671.
This commit is contained in:
ridiculousfish 2021-01-31 15:42:35 -08:00
parent e4a993c581
commit 2d78c9a0d9

View File

@ -79,6 +79,10 @@ char_event_t input_event_queue_t::readb() {
res = select(fd_max + 1, &fdset, nullptr, nullptr, usecs_delay > 0 ? &tv : nullptr);
if (res == -1) {
if (errno == EINTR || errno == EAGAIN) {
// Some uvar notifiers rely on signals - see #7671.
if (notifier.poll()) {
env_universal_barrier();
}
if (interrupt_handler) {
if (auto interrupt_evt = interrupt_handler()) {
return *interrupt_evt;