mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-06 02:37:21 +00:00
Finished terminal working directory restoration
This commit is contained in:
parent
cf4c103660
commit
76c42af62a
1 changed files with 17 additions and 17 deletions
|
@ -574,6 +574,23 @@ impl Terminal {
|
||||||
}
|
}
|
||||||
AlacTermEvent::Wakeup => {
|
AlacTermEvent::Wakeup => {
|
||||||
cx.emit(Event::Wakeup);
|
cx.emit(Event::Wakeup);
|
||||||
|
|
||||||
|
if self.update_process_info() {
|
||||||
|
cx.emit(Event::TitleChanged);
|
||||||
|
|
||||||
|
if let Some(foreground_info) = &self.foreground_process_info {
|
||||||
|
let cwd = foreground_info.cwd.clone();
|
||||||
|
let item_id = self.item_id;
|
||||||
|
let workspace_id = self.workspace_id;
|
||||||
|
cx.background()
|
||||||
|
.spawn(async move {
|
||||||
|
TERMINAL_CONNECTION
|
||||||
|
.save_working_directory(item_id, workspace_id, cwd.as_path())
|
||||||
|
.log_err();
|
||||||
|
})
|
||||||
|
.detach();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
AlacTermEvent::ColorRequest(idx, fun_ptr) => {
|
AlacTermEvent::ColorRequest(idx, fun_ptr) => {
|
||||||
self.events
|
self.events
|
||||||
|
@ -880,23 +897,6 @@ impl Terminal {
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
|
||||||
if self.update_process_info() {
|
|
||||||
cx.emit(Event::TitleChanged);
|
|
||||||
|
|
||||||
if let Some(foreground_info) = &self.foreground_process_info {
|
|
||||||
let cwd = foreground_info.cwd.clone();
|
|
||||||
let item_id = self.item_id;
|
|
||||||
let workspace_id = self.workspace_id;
|
|
||||||
cx.background()
|
|
||||||
.spawn(async move {
|
|
||||||
TERMINAL_CONNECTION
|
|
||||||
.save_working_directory(item_id, workspace_id, cwd.as_path())
|
|
||||||
.log_err();
|
|
||||||
})
|
|
||||||
.detach();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//Note that the ordering of events matters for event processing
|
//Note that the ordering of events matters for event processing
|
||||||
while let Some(e) = self.events.pop_front() {
|
while let Some(e) = self.events.pop_front() {
|
||||||
self.process_terminal_event(&e, &mut terminal, cx)
|
self.process_terminal_event(&e, &mut terminal, cx)
|
||||||
|
|
Loading…
Reference in a new issue