Skip to content

[Terminal] Preview: alternate screen top gap flickers intermittently #61236

Description

@xtay315

Reproduction steps

Open Zed preview v1.12.0
Open a terminal pane
Run hx some_file (or any TUI that uses alternate screen: vim, htop, etc.)
Observe the top of the terminal — a ~1-line blank gap may or may not appear
Move cursor or press : → gap state may flip
Repeat opening and closing the TUI — sometimes the gap is there, sometimes not

Current vs. Expected behavior

This is a regression introduced in preview v1.12.0 . The bug is not the top gap itself (stable v1.11.3 always has it and that's consistent), but that in preview the gap appears and disappears randomly between sessions and redraw events, causing a flickering effect. It feels like a race condition in the terminal pane's dimension reporting during alternate screen transitions — LINES/COLUMNS sometimes reflect the correct renderable area and sometimes not, so the TUI computes a different layout each time. Not reproducible in Ghostty, iTerm2, or Kitty.

Expected: consistent behavior. Either always show the gap like stable, or never show it. Not randomly flip.

Zed version and system specs

Zed preview v1.12.0 , macOS 26.2 (Apple Silicon), helix 25.07.1

Attach Zed log file

Zed.log

Relevant Zed settings

settings.json

Relevant Keymap

keymap.json

(for AI issues) Model provider details

No response

If you are using WSL on Windows, what flavor of Linux are you using?

None

Image Image

Metadata

Metadata

Assignees

Labels

frequency:uncommonBugs that happen for a small subset of users, special configurations, rare circumstances, etcstate:needs infoIssue needs more information from the user before we can do something with itstate:needs triagetriage is not complete: no `area:*` label, or no `priority:*`/`frequency:*` for Bugs/Crashes

Type

Fields

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions