terminal_view: Ensure breadcrumbs are updated on settings change (#35016)

Currently, terminal breadcrumbs are only updated after a settings change
once the terminal view is focused again. This change ensures that the
breadcrumbs are updated instantaneously once the breadcrumb settings
changes.

Release Notes:

- Fixed an issue where terminal breadcrumbs would not react instantly to
settings changes.
This commit is contained in:
Finn Evers 2025-07-24 10:51:40 +02:00 committed by GitHub
parent 913b9296d7
commit dd52fb58fe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -430,6 +430,7 @@ impl TerminalView {
fn settings_changed(&mut self, cx: &mut Context<Self>) {
let settings = TerminalSettings::get_global(cx);
let breadcrumb_visibility_changed = self.show_breadcrumbs != settings.toolbar.breadcrumbs;
self.show_breadcrumbs = settings.toolbar.breadcrumbs;
let new_cursor_shape = settings.cursor_shape.unwrap_or_default();
@ -441,6 +442,9 @@ impl TerminalView {
});
}
if breadcrumb_visibility_changed {
cx.emit(ItemEvent::UpdateBreadcrumbs);
}
cx.notify();
}