terminal_view: Show hollow cursor when bar/underline is unfocused#53713
Open
Dnreikronos wants to merge 1 commit intozed-industries:mainfrom
Open
terminal_view: Show hollow cursor when bar/underline is unfocused#53713Dnreikronos wants to merge 1 commit intozed-industries:mainfrom
Dnreikronos wants to merge 1 commit intozed-industries:mainfrom
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Self-Review Checklist:**
What
When terminal cursor shape is set via escape sequences (e.g.
\e[6 qfor bar,\e[4 qfor 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
BeamandUnderlinein the cursor shape match interminal_element.rs, converting them toHollowwhen the terminal loses focus. This follows the same pattern already used forBlock.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: