Compare commits

...

2 commits

Author SHA1 Message Date
Carlo Taleon
051fa2e444
Merge eaa430843c into e2e7a6769e 2026-05-30 02:09:39 +03:00
Blankeos
eaa430843c fix: Prevent terminal from stealing modal focus. 2026-05-29 14:40:42 +08:00

View file

@ -317,7 +317,8 @@ impl TerminalPanel {
if let Some(workspace) = workspace.upgrade() {
let should_focus = workspace
.update_in(&mut cx, |workspace, window, cx| {
workspace.active_item(cx).is_none()
!workspace.has_active_modal(window, cx)
&& workspace.active_item(cx).is_none()
&& workspace
.is_dock_at_position_open(terminal_panel.position(window, cx), cx)
})
@ -905,6 +906,14 @@ impl TerminalPanel {
)
}));
let reveal_strategy = if workspace.has_active_modal(window, cx)
&& matches!(reveal_strategy, RevealStrategy::Always)
{
RevealStrategy::NoFocus
} else {
reveal_strategy
};
match reveal_strategy {
RevealStrategy::Always => {
workspace.focus_panel::<Self>(window, cx);