mirror of
https://github.com/wez/wezterm.git
synced 2024-11-24 07:46:59 +03:00
Add get_current_working_dir to Tab
This commit is contained in:
parent
b53412d0cb
commit
71eb27ccb5
@ -93,6 +93,10 @@ impl Tab for LocalTab {
|
||||
fn is_mouse_grabbed(&self) -> bool {
|
||||
self.terminal.borrow().is_mouse_grabbed()
|
||||
}
|
||||
|
||||
fn get_current_working_dir(&self) -> Option<String> {
|
||||
self.terminal.borrow().get_current_dir().map(String::from)
|
||||
}
|
||||
}
|
||||
|
||||
impl LocalTab {
|
||||
|
@ -69,6 +69,8 @@ pub trait Tab: Downcast {
|
||||
|
||||
fn set_clipboard(&self, _clipboard: &Arc<dyn Clipboard>) {}
|
||||
|
||||
fn get_current_working_dir(&self) -> Option<String>;
|
||||
|
||||
fn trickle_paste(&self, text: String) -> anyhow::Result<()> {
|
||||
if text.len() <= PASTE_CHUNK_SIZE {
|
||||
// Send it all now
|
||||
|
@ -307,6 +307,10 @@ impl Tab for ClientTab {
|
||||
fn is_mouse_grabbed(&self) -> bool {
|
||||
*self.mouse_grabbed.borrow()
|
||||
}
|
||||
|
||||
fn get_current_working_dir(&self) -> Option<String> {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
|
@ -284,6 +284,10 @@ impl Tab for TermWizTerminalTab {
|
||||
fn is_mouse_grabbed(&self) -> bool {
|
||||
true
|
||||
}
|
||||
|
||||
fn get_current_working_dir(&self) -> Option<String> {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
pub struct TermWizTerminal {
|
||||
|
@ -290,6 +290,10 @@ impl TerminalState {
|
||||
&self.title
|
||||
}
|
||||
|
||||
pub fn get_current_dir(&self) -> Option<&str> {
|
||||
self.current_dir.as_ref().map(String::as_str)
|
||||
}
|
||||
|
||||
/// Returns a copy of the palette.
|
||||
/// By default we don't keep a copy in the terminal state,
|
||||
/// preferring to take the config values from the users
|
||||
|
Loading…
Reference in New Issue
Block a user