Implement "open in terminal"

This commit is contained in:
Conrad Irwin 2024-01-04 09:45:39 -07:00
parent 073128e4f3
commit 4e310b99aa
2 changed files with 11 additions and 20 deletions

View file

@ -971,25 +971,16 @@ impl ProjectPanel {
}
}
fn open_in_terminal(&mut self, _: &OpenInTerminal, _cx: &mut ViewContext<Self>) {
todo!()
// if let Some((worktree, entry)) = self.selected_entry(cx) {
// let window = cx.window();
// let view_id = cx.view_id();
// let path = worktree.abs_path().join(&entry.path);
// cx.app_context()
// .spawn(|mut cx| async move {
// window.dispatch_action(
// view_id,
// &workspace::OpenTerminal {
// working_directory: path,
// },
// &mut cx,
// );
// })
// .detach();
// }
fn open_in_terminal(&mut self, _: &OpenInTerminal, cx: &mut ViewContext<Self>) {
if let Some((worktree, entry)) = self.selected_entry(cx) {
let path = worktree.abs_path().join(&entry.path);
cx.dispatch_action(
workspace::OpenTerminal {
working_directory: path,
}
.boxed_clone(),
)
}
}
pub fn new_search_in_directory(