Skip to content

Pi: /ctx-status overflows terminal height and clips content without scrolling #605

Description

@slighter12

What happened?

/ctx-status can render an overlay taller than the terminal. The lower status sections, close hint, and bottom border are clipped, with no keyboard scrolling to reach the hidden content.

To reproduce:

  1. Use @cortexkit/pi-magic-context v0.44.4 in Pi.
  2. Use a terminal with limited vertical space.
  3. Run /ctx-status with enough status content to exceed the available rows, particularly in the one-column layout.

Expected: the overlay fits within the terminal height, keeps its title, close controls, and bottom border visible, and allows scrolling through all status content.

Diagnostics

Environment:

  • Pi: 1.0.0.
  • Terminal app: Warp.
  • The problem has been observed on both a 14-inch laptop display and a 27-inch external display. Physical display size is context, not a confirmed cause.

An isolated regression test exercising showStatusDialog() reproduced a 45-line component output for a 24-row terminal. Arrow keys did not change the rendered content.

Implementation findings:

  • In packages/pi-plugin/src/dialogs/status-dialog.ts, StatusDialogComponent.render() renders the entire status content and border without checking terminal height. Its input handler only handles closing the dialog.
  • Commit af77e29 changed the default display from a compact summary to the full status view. This is a suspected contributor, not a confirmed first-bad commit.
  • Commit 591f344 introduced a two-column layout to reduce overlay height. Its commit message describes the overlay becoming very tall after the single-view merge, but the one-column fallback remained unchanged, without a height bound or scrolling.
  • No version bisection has been performed.

A local patch against v0.44.4 bounds the component to terminal height, keeps the title and footer outside the scrollable body, adds Up/Down, PageUp/PageDown, and Home/End navigation, and clamps the scroll position after resizing or refreshing. Existing close keys and one-/two-column layout selection are preserved.

Verification:

  • Status tests: 28 passed.
  • Pi extension suite: 1,354 passed, 3 skipped, 0 failed.
  • Typecheck, build, formatting, and installed-extension module import checks passed.
  • I manually tested the patched version in Warp and confirmed that the layout appears fixed.

The patch is local only; no PR has been submitted. This issue requests agreement on the fix direction first.

Plugin version

0.44.4

Platform

macOS arm64

Client

Pi

Activity

  1. slighter12 commented on Oct 2, 2026

    @slighter12
    ContributorAuthor

    Screenshot of the unpatched v0.44.4 overlay in Warp. The bottom border and close hint are not visible. This illustrates the vertical layout issue; the token values shown are outside the scope of this report.

    Image
  2. magic-alfonso commented on Oct 3, 2026

    @magic-alfonso

    Thanks for the detailed report and for already working out a fix. We agree with the approach: keep the title and close hint fixed, cap the body to the terminal height, and scroll it with the arrow keys, Page Up/Down and Home/End. Please go ahead and open the PR. One small request: include a test that renders the dialog at a short terminal height and checks that the bottom border and close hint are still drawn.

  3. slighter12 commented on Oct 3, 2026

    @slighter12
    ContributorAuthor

    I also noticed a /ctx-status layout issue in OpenCode 1.18.34 with Magic Context v0.44.4 and oh-my-opencode-slim installed: the right-hand column extends beyond the dialog background.

    The overflow also reproduces in an isolated component render without slim, so it may not be specific to that plugin combination.

    Image
  4. magic-alfonso commented on Oct 3, 2026

    @magic-alfonso

    Thanks for the second screenshot. That one is in OpenCode's /ctx-status dialog, which is separate code from the Pi overlay, so your Pi PR doesn't need to cover it. We'll fix the OpenCode dialog's right-hand column ourselves and note it here.

  5. added
    design-approvedDesign agreed by a maintainer; a PR referencing this issue can be reviewed
    on Oct 3, 2026
  6. magic-alfonso commented on Oct 4, 2026

    @magic-alfonso

    Fixed in 0.45.0, now on npm. In OpenCode, /ctx-status keeps its two columns inside the dialog. In Pi and OMP (thanks to @slighter12's fix in #611), the overlay stays within the terminal height, keeps its title, close hint and border visible, and scrolls its body with the arrow keys, Page Up/Down and Home/End.

    To update, quit every OpenCode and Pi process first: the database migrates on first start, which can take up to a minute on a large database. OpenCode 1 and Pi pick up the new version on restart. On OpenCode 2 (2.0.22 or newer is now required), open /plugins, select Magic Context and press ctrl+u, or run opencode plugin update. If you still see this on 0.45.0, please reopen with a log.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    design-approvedDesign agreed by a maintainer; a PR referencing this issue can be reviewed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions