# terminal: Fix misaligned mouse selection when inline assist is active \(\#26112\) · gitcafe/zed

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

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

Visibility: public

Requested revision: e7a0f0e8760934f8b6c9fc0fa9acd387fdc93321

Requested commit: e7a0f0e8760934f8b6c9fc0fa9acd387fdc93321

Commit: e7a0f0e8760934f8b6c9fc0fa9acd387fdc93321

Tree: d11e9b2b518f08fc8b694453af374c9213a45321

Author: Hourann

Committer: GitHub

## Message

```
terminal: Fix misaligned mouse selection when inline assist is active (#26112)

This PR fixes an issue where mouse selection in the terminal would be
offset when the Terminal Inline Assistant was active. The problem was
caused by incorrect coordinate translation when handling mouse events
with an active inline assistant.

The fix adjusts mouse event coordinates by properly accounting for the
terminal view's `scroll_top` value when the inline assistant is present,
ensuring that text selection precisely follows the mouse cursor
position.

Closes #26111 

Release Notes:

- Fixed text selection misalignment in terminal when the inline
assistant is active

Co-authored-by: Peter Tripp <peter@zed.dev>
```

## Parents

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

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