mirror of
https://github.com/zed-industries/zed.git
synced 2026-05-25 23:04:27 +00:00
Hide cursor in embedded terminal when not focused (#52404)
## 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. <img width="549" height="496" alt="Screenshot 2026-03-25 at 12 03 15" src="https://github.com/user-attachments/assets/20b29c28-85a7-4f5e-87ea-acf47d15d506" /> ## 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 - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments (N/A - no unsafe code) - [x] The content is consistent with the UI/UX checklist - [x] Tests cover the new/changed behavior (behavior is minimal UI fix, existing tests should cover) - [x] Performance impact has been considered and is acceptable (negligible) Release Notes: - Fixed cursor visibility issue in embedded terminal panels
This commit is contained in:
parent
086060558f
commit
49ed4dc3fe
1 changed files with 8 additions and 1 deletions
|
|
@ -754,7 +754,14 @@ impl TerminalView {
|
|||
}
|
||||
|
||||
pub fn should_show_cursor(&self, focused: bool, cx: &mut Context<Self>) -> bool {
|
||||
// Always show cursor when not focused or in special modes
|
||||
// Hide cursor when in embedded mode and not focused (read-only output like Agent panel)
|
||||
if let TerminalMode::Embedded { .. } = &self.mode {
|
||||
if !focused {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// For Standalone mode: always show cursor when not focused or in special modes
|
||||
if !focused
|
||||
|| self
|
||||
.terminal
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue