Commit 690c38e
committed
Harden the pager's exit and the fallback under an open pager
Seven review findings on the pager-layout fix, in one change.
The pager's teardown could skip its restore: if the display died between
the liveness check and the scheduled exit callback, or the exit raised
before restoring, page() left the full-screen flag and editing mode as the
pager's, and the next main prompt rendered in the alternate screen. The
restore now runs through one nested restore(), on the display's loop when
the exit runs and on the command thread when it does not, so it always
runs exactly once.
Falling back while the pager was open reset the renderer, which quits the
alternate screen and flashes the command output through, and swapped the
layout under the pager. While the pager is on screen the fallback now only
switches routing and redraws, so the native toolbar appears on the
pager's bottom row; the layout and renderer reset wait for the pager's
exit, which applies the display's current layout.
One accessor now applies the display's layout to the application, so the
resume, the fallback and the pager's exit all pick up whichever layout the
display has, and the pager no longer saves a copy to restore. The pager's
teardown and two other sites use the class's own thread_is_alive.
Tests: the mid-pager fallback test now asserts the toolbar is visible and
the pager still up while it is open, and that the alternate screen is
never quit on the wire; a new test fails the pager's exit and checks the
display is restored; pager tests share one driving helper, which closes a
pager that ignores its quit key so a regression fails instead of hanging.
Validation: 2626 passed, 6 skipped with coverage, twice; the mutations
that drop the unconditional restore and that reset under the pager each
fail their test; harness acceptance and dynamic gates PASS at 12, 24 and
40 rows, 23/23 observer controls. make check, make test and make docs-test
passed.1 parent 33647c9 commit 690c38e
4 files changed
Lines changed: 152 additions & 57 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
341 | 341 | | |
342 | 342 | | |
343 | 343 | | |
344 | | - | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
345 | 347 | | |
346 | 348 | | |
347 | 349 | | |
| |||
417 | 419 | | |
418 | 420 | | |
419 | 421 | | |
420 | | - | |
421 | 422 | | |
422 | 423 | | |
423 | | - | |
| 424 | + | |
424 | 425 | | |
425 | | - | |
426 | | - | |
| 426 | + | |
| 427 | + | |
427 | 428 | | |
428 | | - | |
429 | | - | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
430 | 433 | | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
431 | 438 | | |
432 | 439 | | |
433 | 440 | | |
434 | | - | |
435 | | - | |
436 | 441 | | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
437 | 450 | | |
438 | 451 | | |
439 | 452 | | |
| |||
550 | 563 | | |
551 | 564 | | |
552 | 565 | | |
553 | | - | |
| 566 | + | |
554 | 567 | | |
555 | 568 | | |
556 | 569 | | |
| |||
669 | 682 | | |
670 | 683 | | |
671 | 684 | | |
672 | | - | |
| 685 | + | |
673 | 686 | | |
674 | 687 | | |
675 | 688 | | |
| |||
691 | 704 | | |
692 | 705 | | |
693 | 706 | | |
694 | | - | |
695 | | - | |
696 | | - | |
697 | | - | |
698 | 707 | | |
699 | 708 | | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
700 | 723 | | |
701 | 724 | | |
702 | 725 | | |
| |||
718 | 741 | | |
719 | 742 | | |
720 | 743 | | |
721 | | - | |
722 | | - | |
723 | | - | |
| 744 | + | |
724 | 745 | | |
725 | 746 | | |
726 | 747 | | |
| |||
740 | 761 | | |
741 | 762 | | |
742 | 763 | | |
743 | | - | |
744 | | - | |
745 | | - | |
746 | | - | |
747 | | - | |
748 | | - | |
749 | | - | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
750 | 774 | | |
751 | 775 | | |
752 | 776 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1173 | 1173 | | |
1174 | 1174 | | |
1175 | 1175 | | |
1176 | | - | |
| 1176 | + | |
1177 | 1177 | | |
1178 | 1178 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
| 18 | + | |
16 | 19 | | |
17 | 20 | | |
18 | 21 | | |
| |||
560 | 563 | | |
561 | 564 | | |
562 | 565 | | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
563 | 610 | | |
564 | 611 | | |
565 | 612 | | |
| |||
621 | 668 | | |
622 | 669 | | |
623 | 670 | | |
624 | | - | |
625 | | - | |
626 | | - | |
627 | | - | |
628 | | - | |
629 | | - | |
630 | | - | |
631 | | - | |
632 | | - | |
633 | | - | |
634 | | - | |
635 | | - | |
636 | | - | |
637 | | - | |
638 | | - | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
639 | 687 | | |
640 | 688 | | |
641 | 689 | | |
| |||
645 | 693 | | |
646 | 694 | | |
647 | 695 | | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
648 | 716 | | |
649 | 717 | | |
650 | | - | |
651 | | - | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
652 | 723 | | |
653 | 724 | | |
654 | | - | |
655 | | - | |
656 | | - | |
657 | | - | |
658 | | - | |
659 | | - | |
660 | | - | |
661 | | - | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
662 | 730 | | |
663 | 731 | | |
664 | 732 | | |
665 | | - | |
| 733 | + | |
| 734 | + | |
666 | 735 | | |
667 | 736 | | |
668 | | - | |
669 | | - | |
670 | | - | |
671 | | - | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
672 | 742 | | |
673 | 743 | | |
674 | 744 | | |
| |||
0 commit comments