mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-09 03:51:20 -03:00
Revert "Revert "Don't service ioport completions if data is available on stdin""
This reverts commit 005e6f2ab8.
This allows new text entry to take priority over highlighting, improving the
performance of pasting.
This commit is contained in:
@@ -104,13 +104,6 @@ char_event_t input_event_queue_t::readb() {
|
||||
}
|
||||
}
|
||||
|
||||
if (ioport > 0 && FD_ISSET(ioport, &fdset)) {
|
||||
iothread_service_completion();
|
||||
if (auto mc = pop_discard_timeouts()) {
|
||||
return *mc;
|
||||
}
|
||||
}
|
||||
|
||||
if (FD_ISSET(STDIN_FILENO, &fdset)) {
|
||||
unsigned char arr[1];
|
||||
if (read_blocked(0, arr, 1) != 1) {
|
||||
@@ -121,6 +114,15 @@ char_event_t input_event_queue_t::readb() {
|
||||
// We read from stdin, so don't loop.
|
||||
return arr[0];
|
||||
}
|
||||
|
||||
// Check for iothread completions only if there is no data to be read from the stdin.
|
||||
// This gives priority to the foreground.
|
||||
if (ioport > 0 && FD_ISSET(ioport, &fdset)) {
|
||||
iothread_service_completion();
|
||||
if (auto mc = pop_discard_timeouts()) {
|
||||
return *mc;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user