Merge branch 'main' into terminal-selections

This commit is contained in:
Mikayla Maki 2022-07-07 13:20:23 -07:00 committed by GitHub
commit c0c2297deb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -93,6 +93,7 @@ pub struct Terminal {
has_new_content: bool, has_new_content: bool,
has_bell: bool, //Currently using iTerm bell, show bell emoji in tab until input is received has_bell: bool, //Currently using iTerm bell, show bell emoji in tab until input is received
cur_size: SizeInfo, cur_size: SizeInfo,
associated_directory: Option<PathBuf>,
} }
///Upward flowing events, for changing the title and such ///Upward flowing events, for changing the title and such
@ -127,8 +128,8 @@ impl Terminal {
.detach(); .detach();
let pty_config = PtyConfig { let pty_config = PtyConfig {
shell: None, //Use the users default shell shell: None,
working_directory, working_directory: working_directory.clone(),
hold: false, hold: false,
}; };
@ -174,6 +175,7 @@ impl Terminal {
has_new_content: false, has_new_content: false,
has_bell: false, has_bell: false,
cur_size: size_info, cur_size: size_info,
associated_directory: working_directory,
} }
} }
@ -404,6 +406,13 @@ impl Item for Terminal {
.boxed() .boxed()
} }
fn clone_on_split(&self, cx: &mut ViewContext<Self>) -> Option<Self> {
//From what I can tell, there's no way to tell the current working
//Directory of the terminal from outside the terminal. There might be
//solutions to this, but they are non-trivial and require more IPC
Some(Terminal::new(cx, self.associated_directory.clone()))
}
fn project_path(&self, _cx: &gpui::AppContext) -> Option<ProjectPath> { fn project_path(&self, _cx: &gpui::AppContext) -> Option<ProjectPath> {
None None
} }