Use Project's EntityId as the "window id" for Alacritty PTYs (#35876)

It's unfortunate to need to have access to a GPUI window in order to
create a terminal, because it forces to take a `Window` parameter in
entities that otherwise would have been pure models.

This pull request changes it so that we pass the `Project`'s entity id,
which is equally stable as the window id.

Release Notes:

- N/A

Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
This commit is contained in:
Antonio Scandurra 2025-08-08 16:30:49 +02:00 committed by GitHub
parent 95547f099c
commit 51298b6912
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 17 additions and 39 deletions

View file

@ -245,9 +245,8 @@ async fn deserialize_pane_group(
let kind = TerminalKind::Shell(
working_directory.as_deref().map(Path::to_path_buf),
);
let window = window.window_handle();
let terminal = project
.update(cx, |project, cx| project.create_terminal(kind, window, cx));
let terminal =
project.update(cx, |project, cx| project.create_terminal(kind, cx));
Some(Some(terminal))
} else {
Some(None)