Skip to content

terminal_view: Show hollow cursor when bar/underline is unfocused#53713

Open
Dnreikronos wants to merge 1 commit intozed-industries:mainfrom
Dnreikronos:fix/terminal-cursor-unfocused-shape
Open

terminal_view: Show hollow cursor when bar/underline is unfocused#53713
Dnreikronos wants to merge 1 commit intozed-industries:mainfrom
Dnreikronos:fix/terminal-cursor-unfocused-shape

Conversation

@Dnreikronos
Copy link
Copy Markdown
Contributor

@Dnreikronos Dnreikronos commented Apr 11, 2026

Self-Review Checklist:**

  • I've reviewed my own diff for quality, security, and reliability
  • Unsafe blocks (if any) have justifying comments
  • The content is consistent with the UI/UX checklist
  • Tests cover the new/changed behavior
  • Performance impact has been considered and is acceptable

What

When terminal cursor shape is set via escape sequences (e.g. \e[6 q for bar, \e[4 q for underline), the cursor looks identical whether the terminal is focused or unfocused. Block cursors already convert to a hollow outline when unfocused, but bar and underline were missing this treatment.

How

Added unfocused guards for Beam and Underline in the cursor shape match in terminal_element.rs, converting them to Hollow when the terminal loses focus. This follows the same pattern already used for Block.

Why this approach

A hollow block outline is the clearest unfocused signal and stays consistent with the existing Block behavior. Alternative approaches like dimming opacity or drawing outlined versions of bar/underline were considered, but a 2px-wide outlined bar would be nearly invisible at normal font sizes.

Demo:

Before:

terminal_focus.mp4

After:

terminal_focus_after.mp4

Closes #52716

Release Notes:

  • Fixed terminal bar and underline cursors set via escape sequences not visually distinguishing between focused and unfocused states

Previously only Block cursors got an unfocused visual (Hollow). Beam and
Underline cursors set via escape sequences looked identical whether the
terminal was focused or not.

Closes zed-industries#52716
@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Apr 11, 2026
@zed-codeowner-coordinator zed-codeowner-coordinator bot requested review from a team, Anthony-Eid and rtfeldman and removed request for a team April 11, 2026 23:30
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Terminal bar cursor set via escape sequences does not visually distinguish between focused and unfocused state

2 participants