Commit graph

2954 commits

Author SHA1 Message Date
张小白
fff0ecead1
windows: Fix keystroke & keymap (#36572)
Closes #36300

This PR follows Windows conventions by introducing
`KeybindingKeystroke`, so shortcuts now show up as `ctrl-shift-4`
instead of `ctrl-$`.

It also fixes issues with keyboard layouts: when `use_key_equivalents`
is set to true, keys are remapped based on their virtual key codes. For
example, `ctrl-\` on a standard English layout will be mapped to
`ctrl-ё` on a Russian layout.


Release Notes:

- N/A

---------

Co-authored-by: Kate <kate@zed.dev>
2025-08-27 03:24:50 +08:00
John Tur
4605b96630
Fix constant thread creation on Windows (#36779)
See
https://github.com/zed-industries/zed/issues/36057#issuecomment-3215808649

Fixes https://github.com/zed-industries/zed/issues/36057

Release Notes:

- N/A
2025-08-25 12:45:28 -07:00
Ben Kunkle
eeaadc098f
Add GPU info to Sentry crashes (#36624)
Closes #ISSUE

Adds system GPU collection to crash reporting. Currently this is Linux
only.

The system GPUs are determined by reading the `/sys/class/drm` directory
structure, rather than using the exisiting `gpui::Window::gpu_specs()`
method in order to gather more information, and so that the GPU context
is not dependent on Vulkan context initialization (i.e. we still get GPU
info when Zed fails to start because Vulkan failed to initialize).

Unfortunately, the `blade` APIs do not support querying which GPU _will_
be used, so we do not know which GPU was attempted to be used when
Vulkan context initialization fails, however, when Vulkan initialization
succeeds, we send a message to the crash handler containing the result
of `gpui::Window::gpu_specs()` to include the "Active" gpu in any crash
report that may occur

Release Notes:

- N/A *or* Added/Fixed/Improved ...
2025-08-21 19:59:42 -04:00
张小白
8ef9ecc91f
windows: Fix RevealInFileManager (#36592)
Closes #36314

This PR takes inspiration from [Electron’s
implementation](dd54e84a58/shell/common/platform_util_win.cc (L268-L314)).

Before and after:



https://github.com/user-attachments/assets/53eec5d3-23c7-4ee1-8477-e524b0538f60



Release Notes:

- N/A
2025-08-21 08:08:54 +08:00
Piotr Osiewicz
74ce543d8b
clippy: println_empty_string & non_minimal_cfg (#36614)
- **clippy: Fix println-empty-string**
- **clippy: non-minimal-cfg**

Related to #36577

Release Notes:
- N/A
2025-08-20 18:45:40 +00:00
tidely
92352f97ad
Fix clippy::map_clone lint violations (#36585)
#36577

Release Notes:

- N/A
2025-08-20 16:34:52 +02:00
tidely
bc79076ad3
Fix clippy::manual_map lint violations (#36584)
#36577

Release Notes:

- N/A
2025-08-20 15:17:28 +02:00
tidely
7bdc99abc1
Fix clippy::redundant_clone lint violations (#36558)
This removes around 900 unnecessary clones, ranging from cloning a few
ints all the way to large data structures and images.

A lot of these were fixed using `cargo clippy --fix --workspace
--all-targets`, however it often breaks other lints and needs to be run
again. This was then followed up with some manual fixing.

I understand this is a large diff, but all the changes are pretty
trivial. Rust is doing some heavy lifting here for us. Once I get it up
to speed with main, I'd appreciate this getting merged rather sooner
than later.

Release Notes:

- N/A
2025-08-20 12:20:13 +02:00
Piotr Osiewicz
cf7c64d77f
lints: A bunch of extra style lint fixes (#36568)
- **lints: Fix 'doc_lazy_continuation'**
- **lints: Fix 'doc_overindented_list_items'**
- **inherent_to_string and io_other_error**
- **Some more lint fixes**
- **lints: enable bool_assert_comparison, match_like_matches_macro and
wrong_self_convention**


Release Notes:

- N/A
2025-08-20 12:05:58 +02:00
tidely
44941b5dfe
Fix clippy::for_kv_map lint violations (#36493)
Release Notes:

- N/A
2025-08-20 11:22:19 +02:00
Conrad Irwin
cac80e2ebd
Silence a bucketload of logs (#36534)
Closes #ISSUE

Release Notes:

- Silenced a bunch of logs that were on by default
2025-08-19 20:26:56 -06:00
Piotr Osiewicz
6825715503
Another batch of lint fixes (#36521)
- **Enable a bunch of extra lints**
- **First batch of fixes**
- **More fixes**

Release Notes:

- N/A
2025-08-19 20:33:44 +00:00
Piotr Osiewicz
05fc0c432c
Fix a bunch of other low-hanging style lints (#36498)
- **Fix a bunch of low hanging style lints like unnecessary-return**
- **Fix single worktree violation**
- **And the rest**

Release Notes:

- N/A
2025-08-19 21:26:17 +02:00
Piotr Osiewicz
c4083b9b63
Fix unnecessary-mut-passed lint (#36490)
Release Notes:

- N/A
2025-08-19 14:20:01 +00:00
Piotr Osiewicz
8f567383e4
Auto-fix clippy::collapsible_if violations (#36428)
Release Notes:

- N/A
2025-08-19 13:27:24 +00:00
Piotr Osiewicz
ed14ab8c02
gpui: Introduce stacker to address stack overflows with deep layout trees (#35813)
Co-authored-by: Anthony Eid <hello@anthonyeid.me>
Co-authored-by: Lukas Wirth <lukas@zed.dev>
Co-authored-by: Ben Kunkle <ben@zed.dev>

Release Notes:

- N/A

Co-authored-by: Anthony Eid <hello@anthonyeid.me>
Co-authored-by: Lukas Wirth <lukas@zed.dev>
Co-authored-by: Ben Kunkle <ben@zed.dev>
2025-08-19 08:26:37 +00:00
Piotr Osiewicz
9e0e233319
Fix clippy::needless_borrow lint violations (#36444)
Release Notes:

- N/A
2025-08-18 21:54:35 +00:00
localcc
97f784dedf
Fix early dispatch crash on windows (#36445)
Closes #36384

Release Notes:

- N/A
2025-08-18 21:30:02 +00:00
Agus Zubiaga
8b89ea1a80
Handle auth for claude (#36442)
We'll now use the anthropic provider to get credentials for `claude` and
embed its configuration view in the panel when they are not present.

Release Notes:

- N/A
2025-08-18 20:40:59 +00:00
Anthony Eid
3a3df5c011
gpui: Add support for custom prompt text in PathPromptOptions (#36410)
This will be used to improve the clarity of the git clone UI

### MacOS
<img width="1322" height="128" alt="image"
src="https://github.com/user-attachments/assets/3e511143-12c1-4440-89dd-841b21b2e98e"
/>

### Windows 
<img width="338" height="80" alt="image"
src="https://github.com/user-attachments/assets/766d08d6-0c72-4175-ad24-59dc6188d5f1"
/>

### Linux

<img width="387" height="72" alt="Screenshot From 2025-08-18 15-32-06"
src="https://github.com/user-attachments/assets/3125a7c4-3975-462a-a547-d5d4fac48f22"
/>



Release Notes:

- N/A
2025-08-18 19:48:02 +00:00
Marshall Bowers
fa61c3e24d
gpui: Fix typo in handle_gpui_events (#36431)
This PR fixes a typo I noticed in the `handle_gpui_events` method name.

Release Notes:

- N/A
2025-08-18 17:27:23 +00:00
Smit Barmase
7dc4adbd40
gpui: Fix crash when starting Zed on macOS during texture creation (#36382)
Closes #36229

Fix zero-sized texture creation that triggers a SIGABRT in the Metal
renderer. Not sure why this happens yet, but it likely occurs when
`native_window.contentView()` returns a zero `NSSize` during initial
window creation, before the view size is computed.

Release Notes:

- Fixed a rare startup crash on macOS.
2025-08-18 08:16:17 +05:30
Finn Evers
3e0a755486
Remove some redundant entity clones (#36274)
`cx.entity()` already returns an owned entity, so there is no need for
these clones.

Release Notes:

- N/A
2025-08-15 20:27:44 +00:00
Igal Tabachnik
7993ee9c07
Suggest unsaved buffer content text as the default filename (#35707)
Closes #24672

This PR complements a feature added earlier by @JosephTLyons (in
https://github.com/zed-industries/zed/pull/32353) where the text is
considered as the tab title in a new buffer. It piggybacks off that
change and sets the title as the suggested filename in the save dialog
(completely mirroring the same functionality in VSCode):

![2025-08-05 11 50
28](https://github.com/user-attachments/assets/49ad9e4a-5559-44b0-a4b0-ae19890e478e)

Release Notes:

- Text entered in a new untitled buffer is considered as the default
filename when saving
2025-08-15 17:26:38 +02:00
smit
23d0433158
linux: Fix keyboard events not working on first start in X11 (#36224)
Closes #29083

On X11, `ibus-x11` crashes on some distros after Zed interacts with it.
This is not unique to Zed, `xim-rs` shows the same behavior, and there
are similar upstream `ibus` reports with apps like Blender:

- https://github.com/ibus/ibus/issues/2697

I opened an upstream issue to track this:

- https://github.com/ibus/ibus/issues/2789

When this crash happens, we don’t get a disconnect event, so Zed keeps
sending events to the IM server and waits for a response. It works on
subsequent starts because IM server doesn't exist now and we default to
non-XIM path.

This PR detects the crash via X11 events and falls back to the non-XIM
path so typing keeps working. We still need to investigate whether the
root cause is in `xim-rs` or `ibus-x11`.

Release Notes:

- Fixed an issue on X11 where keyboard input sometimes didn’t work on
first start.
2025-08-15 12:51:32 +05:30
David Kleingeld
ba2c45bc53
Add FutureExt::with_timeout and use it for for Room::maintain_connection (#36175)
Release Notes:

- N/A

---------

Co-authored-by: Antonio Scandurra <me@as-cii.com>
2025-08-14 17:02:51 +02:00
Mikayla Maki
32f9de6124
Add grid support to GPUI (#36153)
Release Notes:

- N/A

---------

Co-authored-by: Anthony <anthony@zed.dev>
2025-08-14 00:01:17 +00:00
Max Brunsfeld
09e90fb023
Use trace log level for potentially high-volume vsync duration log (#36147)
This is an attempt to fix
https://github.com/zed-industries/zed/issues/36125

Release Notes:

- N/A
2025-08-13 14:45:34 -07:00
Conrad Irwin
bd61eb0889
Use IBM Plex Sans / Lilex (#36084)
The Zed Plex fonts were found to violate the OFL by using the word Plex
in the name.

Lilex has better ligatures and box-drawing characters than Zed Plex
Mono, but Zed Plex Sans should be identical
to IBM Plex Sans.

Closes #15542
Closes zed-industries/zed-fonts#31

Release Notes:

- The "Zed Plex Sans" and "Zed Plex Mono" fonts have been replaced with
"IBM Plex Sans" and "Lilex". The old names still work for backward
compatibility. Other than fixing line-drawing characters, and improving
the ligatures, there should be little visual change as the fonts are all
of the same family.
- Introduced ".ZedSans" and ".ZedMono" as aliases to allow us to easily
change the default fonts in the future. These currently default to "IBM
Plex Sans" and "Lilex" respectively.
2025-08-13 13:25:52 -06:00
张小白
32975c4208
windows: Fix auto update failure when launching from the cli (#34303)
Release Notes:

- N/A

---------

Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2025-08-12 17:04:30 -07:00
张小白
b62f959528
windows: Fix message loop using too much CPU (#35969)
Closes #34374

This is a leftover issue from #34374. Back in #34374, I wanted to use
DirectX to handle vsync, after all, that’s how 99% of Windows apps do
it. But after discussing with @maxbrunsfeld , we decided to stick with
the original vsync approach given gpui’s architecture.

In my tests, there’s no noticeable performance difference between this
PR’s approach and DirectX vsync. That said, this PR’s method does have a
theoretical advantage, it doesn’t block the main thread while waiting
for vsync.


The only difference is that in this PR, on Windows 11 we use a newer API
instead of `DwmFlush`, since Chrome’s tests have shown that `DwmFlush`
has some problems. This PR also removes the use of
`MsgWaitForMultipleObjects`.


Release Notes:

- N/A

---------

Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2025-08-12 11:28:47 -07:00
Victor Tran
fa3d0aaed4
gpui: Allow selection of "Services" menu independent of menu title (#34115)
Release Notes:

- N/A

---

In the same vein as #29538, the "Services" menu on macOS depended on the
text being exactly "Services", not allowing for i18n of the menu name.

This PR introduces a new menu type called `OsMenu` that defines a
special menu that can be populated by the system. Currently, it takes
one enum value, `ServicesMenu` that tells the system to populate its
contents with the items it would usually populate the "Services" menu
with.

An example of this being used has been implemented in the `set_menus`
example:
`cargo run -p gpui --example set_menus`

---

Point to consider:

In `mac/platform.rs:414` the existing code for setting the "Services"
menu remains for backwards compatibility. Should this remain now that
this new method exists to set the menu, or should it be removed?

---------

Co-authored-by: Mikayla Maki <mikayla.c.maki@gmail.com>
2025-08-11 21:10:14 +00:00
localcc
56c4992b9a
Fix underline flickering (#35989)
Closes #35559

Release Notes:

- Fixed underline flickering
2025-08-11 19:17:48 +02:00
Conrad Irwin
12084b6677
Fix keys not being sent to terminal (#35979)
Fixes #35057

Release Notes:

- Fix input being sent to editor/terminal when pending keystrokes are
resolved
2025-08-11 09:07:32 -06:00
localcc
702a95ffb2
Fix underline DPI (#35816)
Release Notes:

- Fixed wavy underlines looking inconsistent on different displays
2025-08-11 13:57:30 +02:00
Kirill Bulatov
95e302fa68
Properly use static instead of const for global types that need a single init (#35955)
Release Notes:

- N/A
2025-08-10 18:01:54 +00:00
Piotr Osiewicz
daa53f2761
Revert "Revert "chore: Bump Rust to 1.89 (#35788)"" (#35937)
Reverts zed-industries/zed#35843

Docker image for 1.89 is now up.
2025-08-09 23:48:58 +02:00
张小白
2a310d78e1
windows: Fix the issue where ags.dll couldn’t be replaced during update (#35877)
Release Notes:

- N/A

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
2025-08-08 14:42:20 +00:00
Mikayla Maki
c7d641ecb8
Revert "chore: Bump Rust to 1.89 (#35788)" (#35843)
This reverts commit efba2cbfd3.

Unfortunately, the Docker image for 1.89 has not shown up yet. Once it
has, we should re-land this.

Release Notes:

- N/A
2025-08-07 23:55:15 +00:00
Piotr Osiewicz
c1d1d1cff6
chore: Bump to taffy 0.9 (#35802)
Co-authored-by: Anthony Eid <hello@anthonyeid.me>
Co-authored-by: Lukas Wirth <lukas@zed.dev>
Co-authored-by: Ben Kunkle <ben@zed.dev>

Release Notes:

- N/A

Co-authored-by: Anthony Eid <hello@anthonyeid.me>
Co-authored-by: Lukas Wirth <lukas@zed.dev>
Co-authored-by: Ben Kunkle <ben@zed.dev>
2025-08-07 15:43:37 +00:00
Piotr Osiewicz
efba2cbfd3
chore: Bump Rust to 1.89 (#35788)
Release Notes:

- N/A

---------

Co-authored-by: Julia Ryan <juliaryan3.14@gmail.com>
2025-08-07 15:32:06 +00:00
Anthony Eid
f1e69f6311
gpui: Impl Default for ClickEvent (#35751)
While default for ClickEvent shouldn't be used much this is helpful for
other projects using gpui besides Zed. Mainly because the orphan rule
prevents those projects from implementing their own default trait

cc: @huacnlee 

Release Notes:

- N/A
2025-08-06 23:24:37 -04:00
Anthony Eid
010441e23b
debugger: Show run to cursor in editor's context menu (#35745)
This also fixed a bug where evaluate selected text was an available
option when the selected debug session was terminated.


Release Notes:

- debugger: add Run to Cursor back to Editor's context menu

Co-authored-by: Remco Smits <djsmits12@gmail.com>
2025-08-06 15:45:22 -04:00
Max Brunsfeld
40129147c6
Respect paths' content masks when copying them from MSAA texture to drawable (#35688)
Fixes a regression introduced in
https://github.com/zed-industries/zed/pull/34992

### Background

Paths are rendered first to an intermediate MSAA texture, and then
copied to the final drawable. Because paths can have transparency, it's
important that pixels are not copied repeatedly if paths have
overlapping bounding boxes. When N paths have the same draw order, we
infer that they must have disjoint bounding boxes, so that we can copy
them each individually (as opposed to copying a single rect that
contains them all). Previously, the bounding box that we were using to
copy paths was not accounting for the path's content mask (but it is
accounted for in the bounds tree that determines their draw order).


This cause bugs like this, where certain path pixels spuriously had
their opacity doubled:


https://github.com/user-attachments/assets/d792e60c-790b-49ad-b435-6695daba430f

This PR fixes that bug.

* [x] mac
* [x] linux
* [x] windows

Release Notes:

- Fixed a bug where a selection's opacity was computed incorrectly when
it overlapped with another editor's selections in a certain way.
2025-08-05 20:40:33 -07:00
Mikayla Maki
53175263a1
Simplify ListState API (#35685)
Follow up to: https://github.com/zed-industries/zed/pull/35670,
simplifies the List state APIs so you no longer have to worry about
strong vs. weak pointers when rendering list items.

Release Notes:

- N/A

---------

Co-authored-by: Agus Zubiaga <agus@zed.dev>
2025-08-06 00:02:26 +00:00
Max Brunsfeld
d0de81b0b4
windows: Handle scale factor change while window is maximized (#35686)
Fixes https://github.com/zed-industries/zed/issues/33257

Previously, the scale-factor-change-handling logic relied on
`SetWindowPos` enqueuing a `WM_SIZE` window event. But that does not
happen when the window is maximized. So when the scale factor changed,
maximized windows neglected to call their `resize` callback, and would
misinterpret the positions of mouse events.

This PR adds special logic for maximized windows, to ensure that the
size is updated appropriately.

Release Notes:

- N/A
2025-08-05 16:42:17 -07:00
Jason Lee
0025019db4
gpui: Press enter, space to trigger click to focused element (#35075)
Release Notes:

- N/A

> Any user interaction that is equivalent to a click, such as pressing
the Space key or Enter key while the element is focused. Note that this
only applies to elements with a default key event handler, and
therefore, excludes other elements that have been made focusable by
setting the
[tabindex](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/tabindex)
attribute.

https://developer.mozilla.org/en-US/docs/Web/API/Element/click_event

---------

Co-authored-by: Anthony <anthony@zed.dev>
Co-authored-by: Mikayla Maki <mikayla.c.maki@gmail.com>
Co-authored-by: Umesh Yadav <23421535+imumesh18@users.noreply.github.com>
2025-08-05 18:15:30 -04:00
Ben Kunkle
6b77654f66
onboarding: Wire up tab index (#35659)
Closes #ISSUE

Allows tabbing through everything in all three pages. Until #35075 is
merged it is not possible to actually "click" tab focused buttons with
the keyboard.

Additionally adds an action `onboarding::Finish` and displays the
keybind. The action corresponds to both the "Skip all" and "Start
Building" buttons, with the keybind displayed similar to how it is for
the page nav buttons

Release Notes:

- N/A *or* Added/Fixed/Improved ...

---------

Co-authored-by: MrSubidubi <finn@zed.dev>
2025-08-05 19:48:15 +00:00
localcc
844ea3d1ab
Fix open with zed not focusing window (#35645) 2025-08-05 19:09:04 +02:00
Piotr Osiewicz
07e3d53d58
sum_tree: Do not implement Dimension on tuples, use new Dimensions wrapper instead (#35482)
This is a bit of a readability improvement IMHO; I often find myself
confused when dealing when dimension pairs, as there's no easy way to
jump to the implementation of a dimension for tuples to remind myself
for the n-th time how exactly that impl works. Now it should be possible
to jump directly to that impl.

Another bonus is that Dimension supports 3-ary tuples as well - by using
a () as a default value of a 3rd dimension.


Release Notes:

- N/A
2025-08-05 00:37:22 +00:00