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:
parent
95547f099c
commit
51298b6912
7 changed files with 17 additions and 39 deletions
|
@ -1014,10 +1014,9 @@ impl RunningState {
|
|||
..task.resolved.clone()
|
||||
};
|
||||
let terminal = project
|
||||
.update_in(cx, |project, window, cx| {
|
||||
.update(cx, |project, cx| {
|
||||
project.create_terminal(
|
||||
TerminalKind::Task(task_with_shell.clone()),
|
||||
window.window_handle(),
|
||||
cx,
|
||||
)
|
||||
})?
|
||||
|
@ -1189,9 +1188,7 @@ impl RunningState {
|
|||
let workspace = self.workspace.clone();
|
||||
let weak_project = project.downgrade();
|
||||
|
||||
let terminal_task = project.update(cx, |project, cx| {
|
||||
project.create_terminal(kind, window.window_handle(), cx)
|
||||
});
|
||||
let terminal_task = project.update(cx, |project, cx| project.create_terminal(kind, cx));
|
||||
let terminal_task = cx.spawn_in(window, async move |_, cx| {
|
||||
let terminal = terminal_task.await?;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue