Commit ce966eb
committed
Size PTY against window-screen-lines, not window-body-height
ghostel captured terminal height via `(window-body-height)' — which
divides the window's pixel height by frame char height. But the
standard `window-adjust-process-window-size-smallest' (and term.el,
vterm, eat all do likewise) divides by `default-line-height' via
`(window-screen-lines)', which respects `face-remapping-alist' and
`:height' on the default face.
When a theme remaps the buffer's default face — `nano-light' /
`nano-dark' bump it ~7% higher than frame default — the two
metrics disagree. Concrete report (#192): body 1307 px / 27 px
frame char = 48 (window-body-height); 1307 px / 29 px default-line
= 45.069 (window-screen-lines). Init captures 48, libghostty +
PTY spawn at 48 rows; first redisplay fires
`window-configuration-change-hook' (because body-pixel differs
from the freshly-zeroed `old_body_pixel'), the standard adjust-fn
runs, returns 45, and we issue an immediate startup SIGWINCH down
to 45. Claude Code's /tui fullscreen sometimes mishandles the
SIGWINCH-during-startup case and ends up with a collapsed input box.
Switch every height-capture site to `floor(window-screen-lines)':
- `ghostel--init-buffer' and `ghostel-exec' (the spawn paths).
- `ghostel--commit-cropped-size' (minibuffer focus return).
- `ghostel-compile.el' init/reconcile (3 sites) — same bug class.
Add the `(max 1 …)' guard on the init-buffer height that
`ghostel-exec' already had, since `floor' of a sub-1 value is a
real (if unlikely) source of a 0-row terminal.
Remove `ghostel--reconcile-display-size' and its
`window-buffer-change-functions' registration (added in b9c12ca).
Now redundant: with init capturing the right metric, the standard
machinery (`window-configuration-change-hook' →
`window--adjust-process-windows' → `--window-adjust-process-window-size')
catches every transition the helper tried to catch — chrome
reshuffles via `init_iterator''s body-pixel comparison
(xdisp.c:3443-3474), buffer migration via `set_window_buffer'
setting `FRAME_WINDOW_CHANGE'.
Fix the "Size sync" block in `ghostel-debug-info' (added in
0b19011): compare `term-rows' against `(floor (window-screen-lines))'
instead of `window-body-height', and surface the
frame-vs-default line-height delta directly so a face-remap shows
up in the report.
Update affected tests to mock `window-screen-lines'.1 parent ea594fc commit ce966eb
4 files changed
Lines changed: 68 additions & 215 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
548 | 548 | | |
549 | 549 | | |
550 | 550 | | |
551 | | - | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
552 | 554 | | |
553 | 555 | | |
554 | 556 | | |
| |||
626 | 628 | | |
627 | 629 | | |
628 | 630 | | |
629 | | - | |
| 631 | + | |
| 632 | + | |
630 | 633 | | |
631 | 634 | | |
632 | 635 | | |
| |||
659 | 662 | | |
660 | 663 | | |
661 | 664 | | |
662 | | - | |
663 | | - | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
664 | 668 | | |
665 | 669 | | |
666 | 670 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
570 | 570 | | |
571 | 571 | | |
572 | 572 | | |
573 | | - | |
574 | | - | |
575 | | - | |
576 | | - | |
577 | | - | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
578 | 580 | | |
579 | 581 | | |
580 | 582 | | |
| |||
584 | 586 | | |
585 | 587 | | |
586 | 588 | | |
587 | | - | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
588 | 594 | | |
589 | | - | |
590 | | - | |
| 595 | + | |
| 596 | + | |
591 | 597 | | |
592 | | - | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
593 | 604 | | |
594 | 605 | | |
595 | 606 | | |
| |||
599 | 610 | | |
600 | 611 | | |
601 | 612 | | |
602 | | - | |
603 | | - | |
| 613 | + | |
| 614 | + | |
604 | 615 | | |
605 | 616 | | |
606 | 617 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3454 | 3454 | | |
3455 | 3455 | | |
3456 | 3456 | | |
3457 | | - | |
| 3457 | + | |
| 3458 | + | |
3458 | 3459 | | |
3459 | 3460 | | |
3460 | 3461 | | |
| |||
3471 | 3472 | | |
3472 | 3473 | | |
3473 | 3474 | | |
3474 | | - | |
3475 | | - | |
3476 | | - | |
3477 | | - | |
3478 | | - | |
3479 | | - | |
3480 | | - | |
3481 | | - | |
3482 | | - | |
3483 | | - | |
3484 | | - | |
3485 | | - | |
3486 | | - | |
3487 | | - | |
3488 | | - | |
3489 | | - | |
3490 | | - | |
3491 | | - | |
3492 | | - | |
3493 | | - | |
3494 | | - | |
3495 | | - | |
3496 | | - | |
3497 | | - | |
3498 | | - | |
3499 | | - | |
3500 | | - | |
3501 | | - | |
3502 | | - | |
3503 | | - | |
3504 | | - | |
3505 | | - | |
3506 | | - | |
3507 | | - | |
3508 | | - | |
3509 | 3475 | | |
3510 | 3476 | | |
3511 | 3477 | | |
| |||
3543 | 3509 | | |
3544 | 3510 | | |
3545 | 3511 | | |
3546 | | - | |
3547 | | - | |
3548 | 3512 | | |
3549 | 3513 | | |
3550 | 3514 | | |
| |||
3584 | 3548 | | |
3585 | 3549 | | |
3586 | 3550 | | |
3587 | | - | |
3588 | | - | |
3589 | | - | |
| 3551 | + | |
| 3552 | + | |
| 3553 | + | |
| 3554 | + | |
| 3555 | + | |
| 3556 | + | |
| 3557 | + | |
| 3558 | + | |
| 3559 | + | |
| 3560 | + | |
| 3561 | + | |
| 3562 | + | |
3590 | 3563 | | |
3591 | 3564 | | |
3592 | 3565 | | |
3593 | 3566 | | |
3594 | 3567 | | |
3595 | 3568 | | |
3596 | | - | |
3597 | | - | |
| 3569 | + | |
| 3570 | + | |
| 3571 | + | |
| 3572 | + | |
| 3573 | + | |
| 3574 | + | |
| 3575 | + | |
3598 | 3576 | | |
3599 | 3577 | | |
3600 | 3578 | | |
| |||
3658 | 3636 | | |
3659 | 3637 | | |
3660 | 3638 | | |
3661 | | - | |
| 3639 | + | |
| 3640 | + | |
| 3641 | + | |
| 3642 | + | |
| 3643 | + | |
3662 | 3644 | | |
3663 | 3645 | | |
3664 | 3646 | | |
| |||
0 commit comments