Skip to content

terminal: Respect word boundaries after tree branches - #62076

Open
macayu17 wants to merge 1 commit into
zed-industries:mainfrom
macayu17:fix/61767-terminal-word-boundaries
Open

terminal: Respect word boundaries after tree branches#62076
macayu17 wants to merge 1 commit into
zed-industries:mainfrom
macayu17:fix/61767-terminal-word-boundaries

Conversation

@macayu17

@macayu17 macayu17 commented Aug 2, 2026

Copy link
Copy Markdown

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:

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

Release Notes:

  • Fixed terminal word selection around tree branch glyphs.

Copilot AI review requested due to automatic review settings August 2, 2026 09:48
@cla-bot

cla-bot Bot commented Aug 2, 2026

Copy link
Copy Markdown

We require contributors to sign our Contributor License Agreement, and we don't have @macayu17 on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.

@zed-community-bot zed-community-bot Bot added the first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions label Aug 2, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes terminal double-click semantic selection so that service names following systemctl-style tree branch prefixes (e.g. └─) are selected without including the branch glyphs, improving copy/paste usability in the terminal.

Changes:

  • Extend Alacritty terminal config semantic_escape_chars to treat the box-drawing horizontal bar as a semantic word boundary (for both PTY and display-only terminals).
  • Add a regression test asserting semantic selection on └─zms-demo.target returns only zms-demo.target.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@macayu17

macayu17 commented Aug 2, 2026

Copy link
Copy Markdown
Author

@cla-bot check

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Aug 2, 2026
@cla-bot

cla-bot Bot commented Aug 2, 2026

Copy link
Copy Markdown

The cla-bot has been summoned, and re-checked this pull request!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Double click selection in Terminal does not respect word boundaries

2 participants