mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-24 02:46:43 +00:00
Fixed issue where serialized terminal working directories would be lost in complex interactions
Co-authored-by: Kay <kay@zed.dev> Co-authored-by: Julia <julia@zed.dev>
This commit is contained in:
parent
e743f3b1d8
commit
828f406b4f
2 changed files with 4 additions and 5 deletions
|
@ -42,10 +42,10 @@ impl TerminalDb {
|
||||||
}
|
}
|
||||||
|
|
||||||
query! {
|
query! {
|
||||||
pub async fn take_working_directory(item_id: ItemId, workspace_id: WorkspaceId) -> Result<Option<PathBuf>> {
|
pub fn get_working_directory(item_id: ItemId, workspace_id: WorkspaceId) -> Result<Option<PathBuf>> {
|
||||||
DELETE FROM terminals
|
SELECT working_directory
|
||||||
|
FROM terminals
|
||||||
WHERE item_id = ? AND workspace_id = ?
|
WHERE item_id = ? AND workspace_id = ?
|
||||||
RETURNING working_directory
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -706,8 +706,7 @@ impl Item for TerminalView {
|
||||||
let window_id = cx.window_id();
|
let window_id = cx.window_id();
|
||||||
cx.spawn(|pane, mut cx| async move {
|
cx.spawn(|pane, mut cx| async move {
|
||||||
let cwd = TERMINAL_DB
|
let cwd = TERMINAL_DB
|
||||||
.take_working_directory(item_id, workspace_id)
|
.get_working_directory(item_id, workspace_id)
|
||||||
.await
|
|
||||||
.log_err()
|
.log_err()
|
||||||
.flatten();
|
.flatten();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue