From 60fac25960c95c20032f6a60a3a3beb620ff666d Mon Sep 17 00:00:00 2001 From: Bennet Bo Fenner Date: Fri, 10 Apr 2026 09:00:42 +0100 Subject: [PATCH 1/6] agent: Skip serializing empty fields in streaming edit file tool (#53510) Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [ ] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - N/A or Added/Fixed/Improved ... --- crates/agent/src/tools/streaming_edit_file_tool.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/agent/src/tools/streaming_edit_file_tool.rs b/crates/agent/src/tools/streaming_edit_file_tool.rs index 47da35bbf25ad188f3f6b98e843b2955910bb7ac..c988fede454ff6e8b4dc327c81132224a8b87a49 100644 --- a/crates/agent/src/tools/streaming_edit_file_tool.rs +++ b/crates/agent/src/tools/streaming_edit_file_tool.rs @@ -189,9 +189,9 @@ pub enum StreamingEditFileToolOutput { }, Error { error: String, - #[serde(default)] + #[serde(default, skip_serializing_if = "Option::is_none")] input_path: Option, - #[serde(default)] + #[serde(default, skip_serializing_if = "String::is_empty")] diff: String, }, } From 23830d59469e906153c5ce9edbb89ff30bd87629 Mon Sep 17 00:00:00 2001 From: CanWang Date: Fri, 10 Apr 2026 16:05:39 +0800 Subject: [PATCH 2/6] Fix crash on startup when the X11 server supports XInput < 2.4 (#53582) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary - Fix crash on startup when the X11 server supports XInput < 2.4 (e.g. XInput 2.3) - Gesture event mask bits (pinch begin/update/end) are now only requested when the server advertises XInput >= 2.4 - Zed previously failed to open any window on affected systems, printing `Zed failed to open a window: X11 XiSelectEvents failed` ## Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable ## Problem On X11 systems where the XInput extension version is older than 2.4, Zed crashes immediately on startup with: ``` Zed failed to open a window: X11 XiSelectEvents failed. Caused by: X11 error X11Error { error_kind: Value, error_code: 2, sequence: 277, bad_value: 27, minor_opcode: 46, major_opcode: 131, extension_name: Some("XInputExtension"), request_name: Some("XISelectEvents") } ``` This makes Zed completely unusable on any X11 display server that only supports XInput 2.3 or earlier, which includes many current Ubuntu 20.04/22.04 systems, remote X11 sessions, and VNC/Xvfb setups. ### Root cause During window creation, `X11WindowState::new` calls `XISelectEvents` with an event mask that unconditionally includes gesture event bits (`GESTURE_PINCH_BEGIN`, `GESTURE_PINCH_UPDATE`, `GESTURE_PINCH_END`). These gesture events were introduced in **XInput 2.4**. When the X server only supports XInput 2.3 (or older), it does not recognize these mask bits and rejects the entire `XISelectEvents` request with a `BadValue` error. This is fatal because the error is propagated up and prevents the window from being created. A comment in the original code stated: > If the server only supports an older version, gesture events simply won't be delivered. This is incorrect. The X11 protocol does **not** silently ignore unknown mask bits in `XISelectEvents` — it rejects the whole request. ### How XInput version negotiation works The client calls `XIQueryVersion(2, 4)` to announce the highest version it supports. The server responds with the highest version **it** supports (e.g. `2.3`). The client is then responsible for not using features beyond the negotiated version. The existing code ignored the server's response and used 2.4 features unconditionally. ## Fix ### Approach Check the XInput version returned by the server. Only include gesture event mask bits in `XISelectEvents` when the negotiated version is >= 2.4. On older servers, basic input events (motion, button press/release, enter, leave) still work normally — only touchpad pinch gestures are unavailable. ### Changed files **`crates/gpui_linux/src/linux/x11/client.rs`** 1. Added `supports_xinput_gestures: bool` field to `X11ClientState`. 2. After the existing `xinput_xi_query_version(2, 4)` call, compute whether the server version is >= 2.4: ```rust let supports_xinput_gestures = xinput_version.major_version > 2 || (xinput_version.major_version == 2 && xinput_version.minor_version >= 4); ``` 3. Added an `info!` log line reporting the detected XInput version and gesture support status. 4. Pass `supports_xinput_gestures` through `open_window` into `X11Window::new`. **`crates/gpui_linux/src/linux/x11/window.rs`** 1. Added `supports_xinput_gestures: bool` parameter to both `X11Window::new` and `X11WindowState::new`. 2. The `XISelectEvents` call now builds the event mask conditionally: - Always includes: `MOTION`, `BUTTON_PRESS`, `BUTTON_RELEASE`, `ENTER`, `LEAVE` - Only when `supports_xinput_gestures` is true: `GESTURE_PINCH_BEGIN`, `GESTURE_PINCH_UPDATE`, `GESTURE_PINCH_END` ### What is NOT changed - The gesture event **handlers** in `client.rs` (`XinputGesturePinchBegin`, `XinputGesturePinchUpdate`, `XinputGesturePinchEnd`) are left as-is. They simply won't be triggered on servers without gesture support, since the events are never registered. - No behavioral change on systems with XInput >= 2.4 — gesture events continue to work exactly as before. ## Testing | Test | Before fix | After fix | |------|-----------|-----------| | `./target/release/zed .` on XInput 2.3 | Immediate crash (exit code 1) | Window opens successfully (runs until killed) | | XInput version detection | Version queried but response ignored | Version checked and logged | Verified on an X11 system with XInput 2.3 (X.Org 1.20.13, Ubuntu 20.04). ## Test plan - [x] Build succeeds (`cargo build --release`) - [x] Zed launches and opens a window on XInput 2.3 system - [x] No regression on the basic input event path (motion, clicks, enter/leave still registered) - [ ] Verify gesture pinch events still work on a system with XInput >= 2.4 Release Notes: - Fixed Zed failing to start on X11 systems with XInput version older than 2.4, which includes many Linux distributions and remote desktop setups. --- crates/gpui_linux/src/linux/x11/client.rs | 17 ++++++++++++- crates/gpui_linux/src/linux/x11/window.rs | 31 +++++++++++++---------- 2 files changed, 34 insertions(+), 14 deletions(-) diff --git a/crates/gpui_linux/src/linux/x11/client.rs b/crates/gpui_linux/src/linux/x11/client.rs index 57871e6ef32b937a7a47662f8022293a57bc3fe2..bc7c9594734d4fae9a8dda4056bc02d515fbab48 100644 --- a/crates/gpui_linux/src/linux/x11/client.rs +++ b/crates/gpui_linux/src/linux/x11/client.rs @@ -214,6 +214,8 @@ pub struct X11ClientState { pointer_device_states: BTreeMap, + pub(crate) supports_xinput_gestures: bool, + pub(crate) common: LinuxCommon, pub(crate) clipboard: Clipboard, pub(crate) clipboard_item: Option, @@ -345,7 +347,8 @@ impl X11Client { // Announce to X server that XInput up to 2.4 is supported. // Version 2.4 is needed for gesture events (GesturePinchBegin/Update/End). - // If the server only supports an older version, gesture events simply won't be delivered. + // The server responds with the highest version it supports; if < 2.4, + // we must not request gesture event masks in XISelectEvents. let xinput_version = get_reply( || "XInput XiQueryVersion failed", xcb_connection.xinput_xi_query_version(2, 4), @@ -354,6 +357,14 @@ impl X11Client { xinput_version.major_version >= 2, "XInput version >= 2 required." ); + let supports_xinput_gestures = xinput_version.major_version > 2 + || (xinput_version.major_version == 2 && xinput_version.minor_version >= 4); + log::info!( + "XInput version: {}.{}, gesture support: {}", + xinput_version.major_version, + xinput_version.minor_version, + supports_xinput_gestures, + ); let pointer_device_states = current_pointer_device_states(&xcb_connection, &BTreeMap::new()).unwrap_or_default(); @@ -535,6 +546,8 @@ impl X11Client { pointer_device_states, + supports_xinput_gestures, + clipboard, clipboard_item: None, xdnd_state: Xdnd::default(), @@ -1593,6 +1606,7 @@ impl LinuxClient for X11Client { let scale_factor = state.scale_factor; let appearance = state.common.appearance; let compositor_gpu = state.compositor_gpu.take(); + let supports_xinput_gestures = state.supports_xinput_gestures; let window = X11Window::new( handle, X11ClientStatePtr(Rc::downgrade(&self.0)), @@ -1608,6 +1622,7 @@ impl LinuxClient for X11Client { scale_factor, appearance, parent_window, + supports_xinput_gestures, )?; check_reply( || "Failed to set XdndAware property", diff --git a/crates/gpui_linux/src/linux/x11/window.rs b/crates/gpui_linux/src/linux/x11/window.rs index 1974cc0bb28f62da4d7dcb3e9fca92b6324470bb..f29ba49fb2498dd49a5f025aad4dc2584a8a8a42 100644 --- a/crates/gpui_linux/src/linux/x11/window.rs +++ b/crates/gpui_linux/src/linux/x11/window.rs @@ -423,6 +423,7 @@ impl X11WindowState { scale_factor: f32, appearance: WindowAppearance, parent_window: Option, + supports_xinput_gestures: bool, ) -> anyhow::Result { let x_screen_index = params .display_id @@ -660,25 +661,27 @@ impl X11WindowState { ), )?; + let mut xi_event_mask = xinput::XIEventMask::MOTION + | xinput::XIEventMask::BUTTON_PRESS + | xinput::XIEventMask::BUTTON_RELEASE + | xinput::XIEventMask::ENTER + | xinput::XIEventMask::LEAVE; + if supports_xinput_gestures { + // x11rb 0.13 doesn't define XIEventMask constants for gesture + // events, so we construct them from the event opcodes (each + // XInput event type N maps to mask bit N). + xi_event_mask |= + xinput::XIEventMask::from(1u32 << xinput::GESTURE_PINCH_BEGIN_EVENT) + | xinput::XIEventMask::from(1u32 << xinput::GESTURE_PINCH_UPDATE_EVENT) + | xinput::XIEventMask::from(1u32 << xinput::GESTURE_PINCH_END_EVENT); + } check_reply( || "X11 XiSelectEvents failed.", xcb.xinput_xi_select_events( x_window, &[xinput::EventMask { deviceid: XINPUT_ALL_DEVICE_GROUPS, - mask: vec![ - xinput::XIEventMask::MOTION - | xinput::XIEventMask::BUTTON_PRESS - | xinput::XIEventMask::BUTTON_RELEASE - | xinput::XIEventMask::ENTER - | xinput::XIEventMask::LEAVE - // x11rb 0.13 doesn't define XIEventMask constants for gesture - // events, so we construct them from the event opcodes (each - // XInput event type N maps to mask bit N). - | xinput::XIEventMask::from(1u32 << xinput::GESTURE_PINCH_BEGIN_EVENT) - | xinput::XIEventMask::from(1u32 << xinput::GESTURE_PINCH_UPDATE_EVENT) - | xinput::XIEventMask::from(1u32 << xinput::GESTURE_PINCH_END_EVENT), - ], + mask: vec![xi_event_mask], }], ), )?; @@ -855,6 +858,7 @@ impl X11Window { scale_factor: f32, appearance: WindowAppearance, parent_window: Option, + supports_xinput_gestures: bool, ) -> anyhow::Result { let ptr = X11WindowStatePtr { state: Rc::new(RefCell::new(X11WindowState::new( @@ -872,6 +876,7 @@ impl X11Window { scale_factor, appearance, parent_window, + supports_xinput_gestures, )?)), callbacks: Rc::new(RefCell::new(Callbacks::default())), xcb: xcb.clone(), From 5f10547cc3755a44251546dcbdd5f3c4e939861e Mon Sep 17 00:00:00 2001 From: Mikayla Maki Date: Fri, 10 Apr 2026 01:36:15 -0700 Subject: [PATCH 3/6] Dismiss the context menu on interaction (#53599) Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - N/A --- crates/sidebar/src/sidebar.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/sidebar/src/sidebar.rs b/crates/sidebar/src/sidebar.rs index 9c126929a4705de4d3ffc9e6472332e86a07c2e8..4d88ddeffdd6625768dd0207176c0984e9833a29 100644 --- a/crates/sidebar/src/sidebar.rs +++ b/crates/sidebar/src/sidebar.rs @@ -1759,6 +1759,7 @@ impl Sidebar { let menu = ContextMenu::build_persistent(window, cx, move |menu, _window, menu_cx| { + let weak_menu = menu_cx.weak_entity(); let mut menu = menu .header("Project Folders") .end_slot_action(Box::new(menu::EndSlot)); @@ -1771,6 +1772,7 @@ impl Sidebar { let path = path.clone(); let project_group_key = project_group_key.clone(); let multi_workspace = multi_workspace.clone(); + let weak_menu = weak_menu.clone(); menu = menu.entry_with_end_slot_on_hover( name.clone(), None, @@ -1787,6 +1789,7 @@ impl Sidebar { ); }) .ok(); + weak_menu.update(cx, |_, cx| cx.emit(DismissEvent)).ok(); }, ); } @@ -1797,6 +1800,7 @@ impl Sidebar { { let project_group_key = project_group_key.clone(); let multi_workspace = multi_workspace.clone(); + let weak_menu = weak_menu.clone(); move |window, cx| { multi_workspace .update(cx, |multi_workspace, cx| { @@ -1807,13 +1811,13 @@ impl Sidebar { ); }) .ok(); + weak_menu.update(cx, |_, cx| cx.emit(DismissEvent)).ok(); } }, ); let project_group_key = project_group_key.clone(); let multi_workspace = multi_workspace.clone(); - let weak_menu = menu_cx.weak_entity(); menu.separator() .entry("Remove Project", None, move |window, cx| { multi_workspace From 2635ef55c6df198cc11324fdb1bbff690411465b Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Fri, 10 Apr 2026 12:20:38 +0300 Subject: [PATCH 4/6] Restrict mouse wheel zoom for certain editors (#53598) Follow-up of https://github.com/zed-industries/zed/pull/53452 * disables mouse wheel zooming in agent, debugger, keymap editor, dev inspector and repl-related editors * adjusts the code to call for theme changes directly instead of sending the events, so that agent following does not capture the events and changes its font size Release Notes: - N/A --- crates/agent_ui/src/agent_diff.rs | 1 + .../src/conversation_view/thread_view.rs | 1 + crates/agent_ui/src/inline_assistant.rs | 1 + crates/agent_ui/src/message_editor.rs | 1 + .../src/session/running/console.rs | 1 + crates/editor/src/editor.rs | 13 +++++++++++-- crates/editor/src/element.rs | 17 +++++------------ crates/inspector_ui/src/div_inspector.rs | 1 + crates/keymap_editor/src/keymap_editor.rs | 1 + crates/repl/src/notebook/cell.rs | 3 +++ crates/theme_settings/src/settings.rs | 3 ++- crates/theme_settings/src/theme_settings.rs | 19 ++++++++++++++++--- crates/zed/src/zed.rs | 4 ++-- 13 files changed, 46 insertions(+), 20 deletions(-) diff --git a/crates/agent_ui/src/agent_diff.rs b/crates/agent_ui/src/agent_diff.rs index 7b70740dd1ac462614a9d08d9e48d7d13ac2ed32..567595143a41e71a25237e3b1bdcf2301880bccb 100644 --- a/crates/agent_ui/src/agent_diff.rs +++ b/crates/agent_ui/src/agent_diff.rs @@ -98,6 +98,7 @@ impl AgentDiffPane { editor .set_render_diff_hunk_controls(diff_hunk_controls(&thread, workspace.clone()), cx); editor.register_addon(AgentDiffAddon); + editor.disable_mouse_wheel_zoom(); editor }); diff --git a/crates/agent_ui/src/conversation_view/thread_view.rs b/crates/agent_ui/src/conversation_view/thread_view.rs index 412778e054cab1596b2e9555a9cd4a12c3edb6ec..32fe52480e2c347cc482b2296a107ee8731fb672 100644 --- a/crates/agent_ui/src/conversation_view/thread_view.rs +++ b/crates/agent_ui/src/conversation_view/thread_view.rs @@ -5170,6 +5170,7 @@ impl ThreadView { let mut editor = Editor::for_multibuffer(buffer, Some(project.clone()), window, cx); editor.set_breadcrumb_header(thread_title); + editor.disable_mouse_wheel_zoom(); editor })), None, diff --git a/crates/agent_ui/src/inline_assistant.rs b/crates/agent_ui/src/inline_assistant.rs index f2beb719cc7e5638cfc36f339419bda405a8e773..ce74b7f78cda0ea14a79593f83e5666795f80e5e 100644 --- a/crates/agent_ui/src/inline_assistant.rs +++ b/crates/agent_ui/src/inline_assistant.rs @@ -1483,6 +1483,7 @@ impl InlineAssistant { editor.set_show_wrap_guides(false, cx); editor.set_show_gutter(false, cx); editor.set_offset_content(false, cx); + editor.disable_mouse_wheel_zoom(); editor.scroll_manager.set_forbid_vertical_scroll(true); editor.set_read_only(true); editor.set_show_edit_predictions(Some(false), window, cx); diff --git a/crates/agent_ui/src/message_editor.rs b/crates/agent_ui/src/message_editor.rs index 0f59441ab27b5074a710c46a683e72d003a8d5d7..3b93439b62305f63596abcaebe562e7b3f2a65f3 100644 --- a/crates/agent_ui/src/message_editor.rs +++ b/crates/agent_ui/src/message_editor.rs @@ -422,6 +422,7 @@ impl MessageEditor { editor.set_show_indent_guides(false, cx); editor.set_show_completions_on_input(Some(true)); editor.set_soft_wrap(); + editor.disable_mouse_wheel_zoom(); editor.set_use_modal_editing(true); editor.set_context_menu_options(ContextMenuOptions { min_entries_visible: 12, diff --git a/crates/debugger_ui/src/session/running/console.rs b/crates/debugger_ui/src/session/running/console.rs index 65bc949b2b6ddb1a707abf2e001ffde151fb70b8..c541257b6d219b56a611f8a3711da287109ef48d 100644 --- a/crates/debugger_ui/src/session/running/console.rs +++ b/crates/debugger_ui/src/session/running/console.rs @@ -84,6 +84,7 @@ impl Console { editor.set_show_indent_guides(false, cx); editor.set_show_edit_predictions(Some(false), window, cx); editor.set_use_modal_editing(false); + editor.disable_mouse_wheel_zoom(); editor.set_soft_wrap_mode(language::language_settings::SoftWrap::EditorWidth, cx); editor }); diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs index c9c2688f80edc14e879ae50adb654d3cf2c9ae8a..09fc8ece435c8aff22bbf380709669282bd28dcd 100644 --- a/crates/editor/src/editor.rs +++ b/crates/editor/src/editor.rs @@ -1183,6 +1183,7 @@ pub struct Editor { delegate_open_excerpts: bool, enable_lsp_data: bool, enable_runnables: bool, + enable_mouse_wheel_zoom: bool, show_line_numbers: Option, use_relative_line_numbers: Option, show_git_diff_gutter: Option, @@ -1972,6 +1973,9 @@ impl Editor { clone.read_only = self.read_only; clone.buffers_with_disabled_indent_guides = self.buffers_with_disabled_indent_guides.clone(); + clone.enable_mouse_wheel_zoom = self.enable_mouse_wheel_zoom; + clone.enable_lsp_data = self.enable_lsp_data; + clone.enable_runnables = self.enable_runnables; clone } @@ -2419,8 +2423,9 @@ impl Editor { delegate_expand_excerpts: false, delegate_stage_and_restore: false, delegate_open_excerpts: false, - enable_lsp_data: true, - enable_runnables: true, + enable_lsp_data: full_mode, + enable_runnables: full_mode, + enable_mouse_wheel_zoom: full_mode, show_git_diff_gutter: None, show_code_actions: None, show_runnables: None, @@ -26082,6 +26087,10 @@ impl Editor { self.enable_runnables = false; } + pub fn disable_mouse_wheel_zoom(&mut self) { + self.enable_mouse_wheel_zoom = false; + } + fn update_data_on_scroll(&mut self, window: &mut Window, cx: &mut Context<'_, Self>) { self.register_visible_buffers(cx); self.colorize_brackets(false, cx); diff --git a/crates/editor/src/element.rs b/crates/editor/src/element.rs index 12a79fa6695ddff8371fa1b648056f43bec0cb98..24b9606a83a5bcf2a675e3632f4bc2bad41aa591 100644 --- a/crates/editor/src/element.rs +++ b/crates/editor/src/element.rs @@ -7673,22 +7673,18 @@ impl EditorElement { move |event: &ScrollWheelEvent, phase, window, cx| { if phase == DispatchPhase::Bubble && hitbox.should_handle_scroll(window) { - if event.modifiers.secondary() { + delta = delta.coalesce(event.delta); + + if event.modifiers.secondary() && editor.read(cx).enable_mouse_wheel_zoom { let delta_y = match event.delta { ScrollDelta::Pixels(pixels) => pixels.y.into(), ScrollDelta::Lines(lines) => lines.y, }; if delta_y > 0.0 { - window.dispatch_action( - Box::new(zed_actions::IncreaseBufferFontSize { persist: false }), - cx, - ); + theme_settings::increase_buffer_font_size(cx); } else if delta_y < 0.0 { - window.dispatch_action( - Box::new(zed_actions::DecreaseBufferFontSize { persist: false }), - cx, - ); + theme_settings::decrease_buffer_font_size(cx); } cx.stop_propagation(); @@ -7701,10 +7697,7 @@ impl EditorElement { } }; - delta = delta.coalesce(event.delta); editor.update(cx, |editor, cx| { - let position_map: &PositionMap = &position_map; - let line_height = position_map.line_height; let glyph_width = position_map.em_layout_width; let (delta, axis) = match delta { diff --git a/crates/inspector_ui/src/div_inspector.rs b/crates/inspector_ui/src/div_inspector.rs index 7ec2d7ba8303e899331d3f38642a9a51f4c14d4c..135c8f22116498fbc0db43c88928a365e5607ce5 100644 --- a/crates/inspector_ui/src/div_inspector.rs +++ b/crates/inspector_ui/src/div_inspector.rs @@ -498,6 +498,7 @@ impl DivInspector { editor.set_show_breakpoints(false, cx); editor.set_show_git_diff_gutter(false, cx); editor.set_show_runnables(false, cx); + editor.disable_mouse_wheel_zoom(); editor.set_show_edit_predictions(Some(false), window, cx); editor.set_minimap_visibility(MinimapVisibility::Disabled, window, cx); editor diff --git a/crates/keymap_editor/src/keymap_editor.rs b/crates/keymap_editor/src/keymap_editor.rs index ee9f6a11c2b51f7993b17c01352cfb97b535049a..c4833620cf4ec0a6dc965aa9e23c2690a44773fd 100644 --- a/crates/keymap_editor/src/keymap_editor.rs +++ b/crates/keymap_editor/src/keymap_editor.rs @@ -3318,6 +3318,7 @@ impl ActionArgumentsEditor { window, cx, ); + editor.disable_mouse_wheel_zoom(); editor.set_searchable(false); editor.disable_scrollbars_and_minimap(window, cx); editor.set_show_edit_predictions(Some(false), window, cx); diff --git a/crates/repl/src/notebook/cell.rs b/crates/repl/src/notebook/cell.rs index ba70e50f8cbccc32bef5de5c1864a3d8db46aa89..cb8f1d51103fca83cb92718e51a80c42f1e6be62 100644 --- a/crates/repl/src/notebook/cell.rs +++ b/crates/repl/src/notebook/cell.rs @@ -378,6 +378,7 @@ impl MarkdownCell { editor.set_show_gutter(false, cx); editor.set_text_style_refinement(refinement); editor.set_use_modal_editing(true); + editor.disable_mouse_wheel_zoom(); editor }); @@ -641,6 +642,7 @@ impl CodeCell { ..Default::default() }; + editor.disable_mouse_wheel_zoom(); editor.set_show_gutter(false, cx); editor.set_text_style_refinement(refinement); editor.set_use_modal_editing(true); @@ -718,6 +720,7 @@ impl CodeCell { ..Default::default() }; + editor.disable_mouse_wheel_zoom(); editor.set_text(source.clone(), window, cx); editor.set_show_gutter(false, cx); editor.set_text_style_refinement(refinement); diff --git a/crates/theme_settings/src/settings.rs b/crates/theme_settings/src/settings.rs index cda63ab9c8aa10d0f006f3bf371aab6491dff6de..7b8261d27b6ef1c04677d74f868f85e6356daba7 100644 --- a/crates/theme_settings/src/settings.rs +++ b/crates/theme_settings/src/settings.rs @@ -490,7 +490,8 @@ pub fn adjusted_font_size(size: Pixels, cx: &App) -> Pixels { clamp_font_size(adjusted_font_size) } -/// Adjusts the buffer font size. +/// Adjusts the buffer font size, without persisting the result in the settings. +/// This will be effective until the app is restarted. pub fn adjust_buffer_font_size(cx: &mut App, f: impl FnOnce(Pixels) -> Pixels) { let buffer_font_size = ThemeSettings::get_global(cx).buffer_font_size; let adjusted_size = cx diff --git a/crates/theme_settings/src/theme_settings.rs b/crates/theme_settings/src/theme_settings.rs index f5bc96ba02a63088b6311055899b39de65ea9de2..39ffe8327460431ede9c2d1c9a012d0de503fdb2 100644 --- a/crates/theme_settings/src/theme_settings.rs +++ b/crates/theme_settings/src/theme_settings.rs @@ -12,7 +12,7 @@ use std::sync::Arc; use ::settings::{IntoGpui, Settings, SettingsStore}; use anyhow::{Context as _, Result}; -use gpui::{App, Font, HighlightStyle, Pixels, Refineable}; +use gpui::{App, Font, HighlightStyle, Pixels, Refineable, px}; use gpui_util::ResultExt; use theme::{ AccentColors, Appearance, AppearanceContent, DEFAULT_DARK_THEME, DEFAULT_ICON_THEME_NAME, @@ -26,11 +26,12 @@ pub use crate::schema::{ ThemeColorsContent, ThemeContent, ThemeFamilyContent, ThemeStyleContent, WindowBackgroundContent, status_colors_refinement, syntax_overrides, theme_colors_refinement, }; +use crate::settings::adjust_buffer_font_size; pub use crate::settings::{ AgentFontSize, BufferLineHeight, FontFamilyName, IconThemeName, IconThemeSelection, ThemeAppearanceMode, ThemeName, ThemeSelection, ThemeSettings, adjust_agent_buffer_font_size, - adjust_agent_ui_font_size, adjust_buffer_font_size, adjust_ui_font_size, adjusted_font_size, - appearance_to_mode, clamp_font_size, default_theme, observe_buffer_font_size_adjustment, + adjust_agent_ui_font_size, adjust_ui_font_size, adjusted_font_size, appearance_to_mode, + clamp_font_size, default_theme, observe_buffer_font_size_adjustment, reset_agent_buffer_font_size, reset_agent_ui_font_size, reset_buffer_font_size, reset_ui_font_size, set_icon_theme, set_mode, set_theme, setup_ui_font, }; @@ -410,3 +411,15 @@ pub fn merge_accent_colors( accent_colors.0 = Arc::from(colors); } } + +/// Increases the buffer font size by 1 pixel, without persisting the result in the settings. +/// This will be effective until the app is restarted. +pub fn increase_buffer_font_size(cx: &mut App) { + adjust_buffer_font_size(cx, |size| size + px(1.0)); +} + +/// Decreases the buffer font size by 1 pixel, without persisting the result in the settings. +/// This will be effective until the app is restarted. +pub fn decrease_buffer_font_size(cx: &mut App) { + adjust_buffer_font_size(cx, |size| size - px(1.0)); +} diff --git a/crates/zed/src/zed.rs b/crates/zed/src/zed.rs index 3d4ada8a1b90020090eb74a8a6ea752fa7a44ab3..e3cb1b90d46ed8f758ef0334f82fd07b34c93ea9 100644 --- a/crates/zed/src/zed.rs +++ b/crates/zed/src/zed.rs @@ -928,7 +928,7 @@ fn register_actions( .insert(f32::from(theme_settings::clamp_font_size(buffer_font_size)).into()); }); } else { - theme_settings::adjust_buffer_font_size(cx, |size| size + px(1.0)); + theme_settings::increase_buffer_font_size(cx); } } }) @@ -945,7 +945,7 @@ fn register_actions( .insert(f32::from(theme_settings::clamp_font_size(buffer_font_size)).into()); }); } else { - theme_settings::adjust_buffer_font_size(cx, |size| size - px(1.0)); + theme_settings::decrease_buffer_font_size(cx); } } }) From 2d650da0dcbc136fd0752ff7b92327e1d5a9a82e Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Fri, 10 Apr 2026 11:01:12 +0100 Subject: [PATCH 5/6] ci: Do not install cargo machete by building it (#53607) Re-building the tool on CI every time is pointless when can just install the binary itself Release Notes: - N/A or Added/Fixed/Improved ... --- .github/workflows/autofix_pr.yml | 5 ++--- .github/workflows/run_tests.yml | 9 +++------ .../xtask/src/tasks/workflows/autofix_pr.rs | 9 ++++----- tooling/xtask/src/tasks/workflows/run_tests.rs | 18 ++++++------------ 4 files changed, 15 insertions(+), 26 deletions(-) diff --git a/.github/workflows/autofix_pr.yml b/.github/workflows/autofix_pr.yml index 717c5e2fa5e3c35f3ff33d176f73022e7a0c95d4..4c0b4ac378c81f0ab9ee88eee6fa274fa2ed6356 100644 --- a/.github/workflows/autofix_pr.yml +++ b/.github/workflows/autofix_pr.yml @@ -45,10 +45,9 @@ jobs: version: '9' - name: autofix_pr::run_autofix::install_cargo_machete if: ${{ inputs.run_clippy }} - uses: clechasseur/rs-cargo@8435b10f6e71c2e3d4d3b7573003a8ce4bfc6386 + uses: taiki-e/install-action@02cc5f8ca9f2301050c0c099055816a41ee05507 with: - command: install - args: cargo-machete@0.7.0 + tool: cargo-machete@0.7.0 - name: autofix_pr::run_autofix::run_cargo_fix if: ${{ inputs.run_clippy }} run: cargo fix --workspace --release --all-targets --all-features --allow-dirty --allow-staged diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index a1e15e7beb8a7fe3f03536bf8a4fb41519aa4e0a..c9e83554959b5e3281a0094c284b5a45ff121d16 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -618,14 +618,11 @@ jobs: cache: rust path: ~/.rustup - name: run_tests::check_dependencies::install_cargo_machete - uses: clechasseur/rs-cargo@8435b10f6e71c2e3d4d3b7573003a8ce4bfc6386 + uses: taiki-e/install-action@02cc5f8ca9f2301050c0c099055816a41ee05507 with: - command: install - args: cargo-machete@0.7.0 + tool: cargo-machete@0.7.0 - name: run_tests::check_dependencies::run_cargo_machete - uses: clechasseur/rs-cargo@8435b10f6e71c2e3d4d3b7573003a8ce4bfc6386 - with: - command: machete + run: cargo machete - name: run_tests::check_dependencies::check_cargo_lock run: cargo update --locked --workspace - name: run_tests::check_dependencies::check_vulnerable_dependencies diff --git a/tooling/xtask/src/tasks/workflows/autofix_pr.rs b/tooling/xtask/src/tasks/workflows/autofix_pr.rs index 6fa7743275f36eda1746e7afdd4caabc429fec3c..400103b55e78ba32bfcd641802876be536a25af1 100644 --- a/tooling/xtask/src/tasks/workflows/autofix_pr.rs +++ b/tooling/xtask/src/tasks/workflows/autofix_pr.rs @@ -62,12 +62,11 @@ fn run_autofix(pr_number: &WorkflowInput, run_clippy: &WorkflowInput) -> NamedJo fn install_cargo_machete() -> Step { named::uses( - "clechasseur", - "rs-cargo", - "8435b10f6e71c2e3d4d3b7573003a8ce4bfc6386", // v2 + "taiki-e", + "install-action", + "02cc5f8ca9f2301050c0c099055816a41ee05507", ) - .add_with(("command", "install")) - .add_with(("args", "cargo-machete@0.7.0")) + .add_with(("tool", "cargo-machete@0.7.0")) } fn run_cargo_fmt() -> Step { diff --git a/tooling/xtask/src/tasks/workflows/run_tests.rs b/tooling/xtask/src/tasks/workflows/run_tests.rs index b8d6e0636078289b80184edfea29a516774c1fd7..f51b21b961ddbeabf30c5e757bdf6815833ab3ca 100644 --- a/tooling/xtask/src/tasks/workflows/run_tests.rs +++ b/tooling/xtask/src/tasks/workflows/run_tests.rs @@ -408,21 +408,15 @@ fn check_style() -> NamedJob { fn check_dependencies() -> NamedJob { fn install_cargo_machete() -> Step { named::uses( - "clechasseur", - "rs-cargo", - "8435b10f6e71c2e3d4d3b7573003a8ce4bfc6386", // v2 + "taiki-e", + "install-action", + "02cc5f8ca9f2301050c0c099055816a41ee05507", ) - .add_with(("command", "install")) - .add_with(("args", "cargo-machete@0.7.0")) + .add_with(("tool", "cargo-machete@0.7.0")) } - fn run_cargo_machete() -> Step { - named::uses( - "clechasseur", - "rs-cargo", - "8435b10f6e71c2e3d4d3b7573003a8ce4bfc6386", // v2 - ) - .add_with(("command", "machete")) + fn run_cargo_machete() -> Step { + named::bash("cargo machete") } fn check_cargo_lock() -> Step { From 00c771af0a3eefbd5b0c4d4496b78adbd9e351bd Mon Sep 17 00:00:00 2001 From: Andre Roelofs Date: Fri, 10 Apr 2026 13:16:51 +0200 Subject: [PATCH 6/6] terminal: Properly apply focus when switching terminal via tabbing hotkey (#53127) Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [ ] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Closes #53056. Release Notes: - Fixed terminal tabs losing keyboard focus after switching tabs on Linux X11 --- crates/terminal_view/src/terminal_view.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/terminal_view/src/terminal_view.rs b/crates/terminal_view/src/terminal_view.rs index acccd6129f75ee2f5213fa359203220a7fee08c0..2f6a984798f35c87e39f51978ad84bfdfa435187 100644 --- a/crates/terminal_view/src/terminal_view.rs +++ b/crates/terminal_view/src/terminal_view.rs @@ -1356,7 +1356,9 @@ impl Item for TerminalView { h_flex() .gap_1() .group("term-tab-icon") - .track_focus(&self.focus_handle) + .when(!params.selected, |this| { + this.track_focus(&self.focus_handle) + }) .on_action(move |action: &RenameTerminal, window, cx| { self_handle .update(cx, |this, cx| this.rename_terminal(action, window, cx))