fix(command): close the command overlay on Escape

This commit is contained in:
2026-07-10 16:35:53 -04:00
parent 18fe57ddc6
commit a12b8c8bd8
2 changed files with 17 additions and 0 deletions
+12
View File
@@ -15,6 +15,18 @@ impl ElyShell {
});
}
}
/// Close the command overlay (Escape or a backdrop click): drop the
/// `>` query that drives its visibility, reset the selection, and put
/// the active tab's address back in the omnibar.
pub(super) fn exit_command_mode(&mut self, window: &mut Window, cx: &mut Context<Self>) {
if let ShellState::Ready(core) = &mut self.state {
core.set_command_query("");
}
self.command_selected_index = 0;
self.sync_address_input(window, cx);
cx.notify();
}
}
impl Focusable for ElyShell {
+5
View File
@@ -259,6 +259,11 @@ impl ElyShell {
cx: &mut Context<Self>,
) {
let key = event.keystroke.key.as_str();
if key == "escape" {
self.exit_command_mode(window, cx);
cx.stop_propagation();
return;
}
if !matches!(key, "up" | "down" | "enter") {
return;
}