# terminal: Swap right and middle mouse button mappings \(\#59844\) · gitcafe/zed

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

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

Visibility: public

Requested revision: e6ea825ffabb19a72a3b7b2276471343e6ff7fac

Requested commit: e6ea825ffabb19a72a3b7b2276471343e6ff7fac

Commit: e6ea825ffabb19a72a3b7b2276471343e6ff7fac

Tree: a00c07887336ff1569c4800dd11104b5860238e1

Author: he-thinks

Committer: GitHub

## Message

```
terminal: Swap right and middle mouse button mappings (#59844)

# Objective

`MouseButton::Right` was mapped to `MouseButtonCode::MiddleButton` and
vice versa, causing right-click and middle-click to behave as each other
in the terminal.

## Solution

Swapped the two arms of the match expression in
`crates/terminal/src/mappings/mouse.rs`.

## Testing

Tested manually: opened a terminal pane, verified that right-click and
middle-click now produce the correct events.

Tested on: Windows

## Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [ ] Unsafe blocks (if any) have justifying comments
- [ ] The content adheres to Zed's UI standards (UX/UI and icon
guidelines)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

---

Release Notes:

- Fixed right-click and middle-click being swapped in the terminal.
```

## Parents

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

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