# Fix Terminal focus handlers not being called \(\#7428\) · gitcafe/zed

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

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

Visibility: public

Requested revision: c591681bad394ee8d956b7a1940036c4791b4910

Requested commit: c591681bad394ee8d956b7a1940036c4791b4910

Commit: c591681bad394ee8d956b7a1940036c4791b4910

Tree: 8a864bf2d1e48040c2dd974303ecfb6846fc9659

Author: Thorsten Ball

Committer: GitHub

## Message

```
Fix Terminal focus handlers not being called (#7428)

This fixes #7401 and probably a few other things that seemed odd with
the terminal.

Turns out that `TerminalView` has `focus_in` and `focus_out` callbacks,
but they were never called. The `focus_handle` on which they were set
was not passed in to `TerminalView`.

That meant that the `impl FocusableView for TerminalView` never returned
the focus handle with the right callbacks.

This change here uses the already created focus handle and passes it in,
so that `focus_in` and `focus_out` are now correctly called.

Release Notes:

- Fixed terminal not handling focus-state correctly and, for example,
not restoring cursor blinking state correctly.
([#7401](https://github.com/zed-industries/zed/issues/7401)).
```

## Parents

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

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