mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-21 22:32:12 +08:00
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:
parent
e4a993c581
commit
2d78c9a0d9
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user