# terminal: Keep alternate screen bottom-aligned \(\#61325\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/37b9fbf22bb3d938ecbfaa9fe440c325cc999e66)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 37b9fbf22bb3d938ecbfaa9fe440c325cc999e66

Requested commit: 37b9fbf22bb3d938ecbfaa9fe440c325cc999e66

Commit: 37b9fbf22bb3d938ecbfaa9fe440c325cc999e66

Tree: 872b28f53ffe2f3f5fc39a3543ee55b5bfbb17ae

Author: XiaoYan Li

Committer: GitHub

## Message

```
terminal: Keep alternate screen bottom-aligned (#61325)

# Objective

Fixes #61236

## Solution

This regression was introduced by #56715, which switches the alignment
based on whether the last row contains any content. However, this logic
can cause issues in the alternate screen. This PR fixes the problem by
excluding the alternate screen from the detection logic.

## Testing

Open Zed’s integrated terminal and run a program that uses the alternate
screen, such as Vim or Helix.

## Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

## Showcase


https://github.com/user-attachments/assets/ffc1ca56-596a-439a-8672-12868f9dc112

---

Release Notes:

- Fixed flickering in the integrated terminal when using the alternate
screen.
```

## Parents

- [cb8a0170ff5db90878ee362610bf97cc013e73f0](https://git.cafe/gitcafe/zed/commit/cb8a0170ff5db90878ee362610bf97cc013e73f0?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/37b9fbf22bb3d938ecbfaa9fe440c325cc999e66?format=markdown)
