Skip to content

Commit

Permalink
[IT-24] providing cmd arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
Harzu committed Nov 24, 2024
1 parent 9726602 commit d58c4a4
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 8 deletions.
3 changes: 2 additions & 1 deletion examples/custom_bindings/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ impl App {
},
theme: iced_term::settings::ThemeSettings::default(),
backend: iced_term::settings::BackendSettings {
shell: system_shell.to_string(),
cmd: system_shell.to_string(),
..Default::default()
},
};

Expand Down
3 changes: 2 additions & 1 deletion examples/fonts/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ impl App {
},
theme: iced_term::settings::ThemeSettings::default(),
backend: iced_term::settings::BackendSettings {
shell: system_shell.to_string(),
cmd: system_shell.to_string(),
..Default::default()
},
};

Expand Down
3 changes: 2 additions & 1 deletion examples/full_screen/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ impl App {
},
theme: iced_term::settings::ThemeSettings::default(),
backend: iced_term::settings::BackendSettings {
shell: system_shell.to_string(),
cmd: system_shell.to_string(),
..Default::default()
},
};

Expand Down
3 changes: 2 additions & 1 deletion examples/split_view/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ impl App {
},
theme: iced_term::settings::ThemeSettings::default(),
backend: iced_term::settings::BackendSettings {
shell: env!("SHELL").to_string(),
cmd: env!("SHELL").to_string(),
..Default::default()
},
};
let tab = iced_term::Terminal::new(
Expand Down
3 changes: 2 additions & 1 deletion examples/themes/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ impl App {
},
theme: iced_term::settings::ThemeSettings::default(),
backend: iced_term::settings::BackendSettings {
shell: system_shell.to_string(),
cmd: system_shell.to_string(),
..Default::default()
},
};

Expand Down
2 changes: 1 addition & 1 deletion src/backend/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ impl Backend {
font_size: Size<f32>,
) -> Result<Self> {
let pty_config = tty::Options {
shell: Some(tty::Shell::new(settings.shell, vec![])),
shell: Some(tty::Shell::new(settings.cmd, settings.args)),
..tty::Options::default()
};
let config = term::Config::default();
Expand Down
6 changes: 4 additions & 2 deletions src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@ pub struct Settings {

#[derive(Debug, Clone)]
pub struct BackendSettings {
pub shell: String,
pub cmd: String,
pub args: Vec<String>
}

impl Default for BackendSettings {
fn default() -> Self {
Self {
shell: DEFAULT_SHELL.to_string(),
cmd: DEFAULT_SHELL.to_string(),
args: vec![],
}
}
}
Expand Down

0 comments on commit d58c4a4

Please sign in to comment.