Open Tom-Boscher opened 11 months ago
For sure @Tom-Boscher, this is an inconsistency between how the center workspace and terminal panel work, and we should fix it.
What kind of work would need to be done to move this forward @JosephTLyons? What do the terminal and workspace share in common?
I'm interested to help too!
Interested to see this!
The place to go after this is in clone_on_split
of the impl Item for TerminalView
of crates/terminal_view/src/terminal_view.rs
.Based on the current comment it appears that there's more work to be done to make it keep the current working directory:
fn clone_on_split(
&self,
_workspace_id: WorkspaceId,
_cx: &mut ViewContext<Self>,
) -> Option<View<Self>> {
//From what I can tell, there's no way to tell the current working
//Directory of the terminal from outside the shell. There might be
//solutions to this, but they are non-trivial and require more IPC
// Some(TerminalContainer::new(
// Err(anyhow::anyhow!("failed to instantiate terminal")),
// workspace_id,
// cx,
// ))
// TODO
None
}
Example implementation you can look at is https://github.com/zed-industries/zed/pull/9425.
As @mikayla-maki pointed out below, the Model<Terminal>
has a get_cwd()
method. This will probably get you started:
fn clone_on_split(
&self,
workspace_id: WorkspaceId,
cx: &mut ViewContext<Self>,
) -> Option<View<Self>> {
Some(cx.new_view(|cx| {
TerminalView::new(
self.terminal.clone(),
self.workspace.clone(),
workspace_id,
cx,
)
}))
}
FYI for anyone looking to implement this, that comment is out of date. the Model<Terminal>
has a get_cwd()
method on it that can be used for this purpose.
I still can't figure out how to split the terminal pane so I can see two terminals at once. Is this feature on the project roadmap? Do we know when this feature may be available?
I still can't figure out how to split the terminal pane so I can see two terminals at once. Is this feature on the project roadmap? Do we know when this feature may be available?
Can you drag the second terminal tab and position it side by side with the first terminal?
How can I prevent Zed from opening code files in the terminal tab when it’s docked vertically? I often forget to switch focus, and new files end up in the terminal pane.
Related UX proposal to improve pane management:
Check for existing issues
Describe the feature
It would be great if (like in VSCode) we could divide terminal panel in several pane. Currently we have to use tabs but we can’t display tabs in several splitted pane in terminal panel.
If applicable, add mockups / screenshots to help present your vision of the feature
No response