Ray's Knowledge Base
Unlock

A pi custom() popup has no fixed height; cut it to the terminal rows

PitfallVerified 2 Oct 2026Holds anywhere
Pitfall. The symptom, what causes it, and the fix that was run and seen to work.

Symptom#

A pi custom() popup gets no fixed height from pi. A long item then fills more rows than the terminal has, so the footer and the "more lines" note scroll out of view and the user cannot reach them.

Cause#

pi sizes the popup to the content, not the terminal.

Fix#

Cut the popup to the terminal rows minus about 8, so pi's own footer still shows, and scroll inside it with a position line such as lines 1-30 of 210. Unit tests drawn at a fixed size do not catch this; it showed only in a real pi in tmux.

Evidence#

Real pi in tmux; the row cap fixed the lost footer.

Also found by searching

  • a pi custom popup gets no fixed height and the footer scrolls out of view
  • long item fills more rows than the terminal has
  • cut the popup to the terminal rows minus about 8 so pi's footer still shows
  • scroll inside with a position line such as lines 1-30 of 210