# terminal_view: Fix inline terminal clipping its first line of output \(\#61939\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 0b3621db47895cc0993aa2b934177b4aa1ba7548

Requested commit: 0b3621db47895cc0993aa2b934177b4aa1ba7548

Commit: 0b3621db47895cc0993aa2b934177b4aa1ba7548

Tree: e833c272eb3878c715ab2a3e1a52f6ddb44d2303

Author: Tim Vermeulen

Committer: GitHub

## Message

```
terminal_view: Fix inline terminal clipping its first line of output (#61939)

Fixes #53518:

| before | after |
| --- | --- |
| <img width="790" height="458" alt="before"
src="https://github.com/user-attachments/assets/2314fb13-6782-4397-a022-0252c82bf7b9"
/> | <img width="790" height="458" alt="after"
src="https://github.com/user-attachments/assets/1058970c-ae0a-4a9f-8f14-84b810ddaba4"
/> |

`TerminalBounds::line_height` floors `height / line_height`, so
`TerminalElement::request_layout` does the inverse logic to calculate
the height for inline terminals with `displayed_lines * line_height`,
but intermediate rounding in `to_taffy` could break this. Fixed by
rounding up to the next integer device pixel in
`TerminalElement::request_layout`.

## 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

---

Release Notes:

- Fixed the first line of terminal output sometimes being hidden in the
agent panel.
```

## Parents

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

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