Skip to content

A modern terminal with a built-in multiplexer: close it and your sessions keep running. Run shells and tons of AI agents across your machines, then pick them up from desktop, browser, TUI and more. Written in Rust with no UI framework: interface drawn straight on the GPU. No Electron, GPUI or webview.

fix(settings): remember the window that opened Check for Updates

RoversXd20c4668bb0b
diff --git a/wezterm-gui/src/settings_window.rs b/wezterm-gui/src/settings_window.rs
index 19d712bc..d4f80513 100644
--- a/wezterm-gui/src/settings_window.rs
+++ b/wezterm-gui/src/settings_window.rs
@@ -935,7 +935,6 @@ impl SettingsSection {
Self::Import => &[
"Herdr",
"Import Session",
- "导入",
"ThinkTerm Config",
"WezTerm Source",
"Copy WezTerm Config",
@@ -2908,6 +2907,18 @@ pub fn show_update_page() {
/// Open Settings, remembering which window asked. See `OPENED_FROM`.
pub fn show_from(mux_window_id: MuxWindowId, space_id: &str) {
+ remember_origin(mux_window_id, space_id);
+ show();
+}
+
+/// `show_update_page` asked from a terminal window. The Import page must
+/// target that window's Space, not the one Settings was last opened from.
+pub fn show_update_page_from(mux_window_id: MuxWindowId, space_id: &str) {
+ remember_origin(mux_window_id, space_id);
+ show_update_page();
+}
+
+fn remember_origin(mux_window_id: MuxWindowId, space_id: &str) {
OPENED_FROM.with(|slot| slot.set(Some(mux_window_id)));
let changed = OPENED_FROM_SPACE
.with(|slot| slot.replace(Some(space_id.to_string())).as_deref() != Some(space_id));
@@ -2926,7 +2937,6 @@ pub fn show_from(mux_window_id: MuxWindowId, space_id: &str) {
}
#[cfg(not(unix))]
let _ = changed;
- show();
}
pub fn show() {
diff --git a/wezterm-gui/src/termwindow/mod.rs b/wezterm-gui/src/termwindow/mod.rs
index e640a985..864feb8c 100644
--- a/wezterm-gui/src/termwindow/mod.rs
+++ b/wezterm-gui/src/termwindow/mod.rs
@@ -10959,7 +10959,10 @@ impl TermWindow {
return self.perform_key_assignment(pane, &QuitApplication);
}
CheckForUpdates => {
- crate::settings_window::show_update_page();
+ crate::settings_window::show_update_page_from(
+ self.mux_window_id,
+ &self.active_space_id,
+ );
}
OpenSshHosts => {
self.toggle_ssh_hosts_view();