# Fix active pane border and pane opacity dimming showing simultaneously on editor panes and terminal panes \(\#56595\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 8f6f8a54b9933059f1963af601369e0555e32649

Requested commit: 8f6f8a54b9933059f1963af601369e0555e32649

Commit: 8f6f8a54b9933059f1963af601369e0555e32649

Tree: cdb21f662660c4b3086db39f1b9cbd92b35600a9

Author: Aks

Committer: GitHub

## Message

```
Fix active pane border and pane opacity dimming showing simultaneously on editor panes and terminal panes (#56595)

When `active_pane_modifiers.border_size` is set in `settings.json`, both
the active editor pane and the active terminal pane would display a
border simultaneously, making it impossible to tell which pane actually
has focus. The pane opacity dimming also renders simultaneously before
this fix.

1. Before fix: impossible to tell which pane has focus
<img width="901" height="732" alt="image"
src="https://github.com/user-attachments/assets/cbcad798-0d72-420c-9585-2dafa867ff2b"
/>

2. After fix: only one pane has focus
<img width="902" height="731" alt="image"
src="https://github.com/user-attachments/assets/97f2238e-4789-41b3-97e3-98cb9a0c82ef"
/>

The root cause is that both the workspace center and the terminal panel
pass their own `active_pane` to `PaneRenderContext`, so each pane group
unconditionally marks its active pane for border rendering. The fix adds
a focus check so `active_pane_ix` is only set when the pane actually has
keyboard focus, ensuring only the truly focused pane gets the border
(and the inactive_opacity dimming applies correctly to unfocused
groups).

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 is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable


Release Notes:

- Fixed active pane border being drawn on both the editor pane and
terminal pane simultaneously

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
```

## Parents

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

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