# terminal: Respect word boundaries after tree branches \(\#62076\) · gitcafe/zed

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

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

Visibility: public

Requested revision: f25b256f2c10e1b638031a3d8d5a524056ebf268

Requested commit: f25b256f2c10e1b638031a3d8d5a524056ebf268

Commit: f25b256f2c10e1b638031a3d8d5a524056ebf268

Tree: 1baa3177426e472d10e5ac821fbb8ae2298fe7d5

Author: Ayush

Committer: GitHub

## Message

```
terminal: Respect word boundaries after tree branches (#62076)

# Objective

Fixes #61767.

Double-clicking a service name after a `systemctl` tree branch also
selects the `└─` prefix.

## Solution

Add `─` to Alacritty's semantic escape characters for both PTY and
display-only terminals. The regression test checks that selecting
`└─zms-demo.target` returns only `zms-demo.target`.

## Testing

  - `cargo fmt --all -- --check`
  - `git diff --check`
  - Added `semantic_selection_stops_at_tree_branch`

The regression test could not run locally because this Windows
environment does not have MSVC's `link.exe`. It can be run with:

  `cargo test -p terminal semantic_selection_stops_at_tree_branch`

## 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
  - [x] Tests cover the new/changed behavior
  - [x] Performance impact has been considered and is acceptable

---
  Release Notes:

  - Fixed terminal word selection around tree branch glyphs.
```

## Parents

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

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