Skip to content

Hide cursor in embedded terminal when not focused#52404

Merged
Veykril merged 2 commits intozed-industries:mainfrom
anaslimem:hide-cursor
Mar 30, 2026
Merged

Hide cursor in embedded terminal when not focused#52404
Veykril merged 2 commits intozed-industries:mainfrom
anaslimem:hide-cursor

Conversation

@anaslimem
Copy link
Copy Markdown
Contributor

@anaslimem anaslimem commented Mar 25, 2026

Context

Fixes #52063
This change hides the cursor in embedded terminal mode when not focused. Embedded mode is used for read-only terminal output (like the Agent panel). Showing a cursor in a read-only context when unfocused is confusing, so we suppress it.
Screenshot 2026-03-25 at 12 03 15

How to Review

The change is in a single file: crates/terminal_view/src/terminal_view.rs:754-761.
Focus on the should_show_cursor() method
Verify the logic correctly hides the cursor only when both conditions are met (Embedded mode AND not focused).

Self-Review Checklist

  • I've reviewed my own diff for quality, security, and reliability
  • Unsafe blocks (if any) have justifying comments (N/A - no unsafe code)
  • The content is consistent with the UI/UX checklist
  • Tests cover the new/changed behavior (behavior is minimal UI fix, existing tests should cover)
  • Performance impact has been considered and is acceptable (negligible)

Release Notes:

  • Fixed cursor visibility issue in embedded terminal panels

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Mar 25, 2026
@zed-codeowner-coordinator zed-codeowner-coordinator bot requested a review from a team March 25, 2026 17:06
@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 Mar 25, 2026
@zed-codeowner-coordinator zed-codeowner-coordinator bot requested review from Veykril and cole-miller and removed request for a team March 25, 2026 17:06
@anaslimem
Copy link
Copy Markdown
Contributor Author

@Veykril Can u see it please?

@Vastargazing
Copy link
Copy Markdown
Contributor

The comment on line 764 says // Always show cursor when not focused or in special modes, but after this change it only applies to Standalone mode — Embedded + !focused now returns early above.

@anaslimem
Copy link
Copy Markdown
Contributor Author

You're right I should update it to clarify that the "always show" logic only applies to Standalone mode.

Copy link
Copy Markdown
Member

@Veykril Veykril left a comment

Choose a reason for hiding this comment

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

Thanks!

@Veykril Veykril enabled auto-merge (squash) March 30, 2026 07:31
@Veykril Veykril merged commit 49ed4dc into zed-industries:main Mar 30, 2026
30 checks passed
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.

Cursor visible in output-only Agent Panel terminal

3 participants