aboutsummaryrefslogtreecommitdiff
path: root/alacritty_terminal/src/tty/windows/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'alacritty_terminal/src/tty/windows/mod.rs')
-rw-r--r--alacritty_terminal/src/tty/windows/mod.rs13
1 files changed, 6 insertions, 7 deletions
diff --git a/alacritty_terminal/src/tty/windows/mod.rs b/alacritty_terminal/src/tty/windows/mod.rs
index 080f6e83..cbd803f1 100644
--- a/alacritty_terminal/src/tty/windows/mod.rs
+++ b/alacritty_terminal/src/tty/windows/mod.rs
@@ -5,10 +5,9 @@ use std::os::windows::ffi::OsStrExt;
use std::sync::mpsc::TryRecvError;
use std::sync::Arc;
-use crate::config::{Program, PtyConfig};
use crate::event::{OnResize, WindowSize};
use crate::tty::windows::child::ChildExitWatcher;
-use crate::tty::{ChildEvent, EventedPty, EventedReadWrite};
+use crate::tty::{ChildEvent, EventedPty, EventedReadWrite, Options, Shell};
mod blocking;
mod child;
@@ -34,7 +33,7 @@ pub struct Pty {
child_watcher: ChildExitWatcher,
}
-pub fn new(config: &PtyConfig, window_size: WindowSize, _window_id: u64) -> Result<Pty> {
+pub fn new(config: &Options, window_size: WindowSize, _window_id: u64) -> Result<Pty> {
conpty::new(config, window_size)
.ok_or_else(|| Error::new(ErrorKind::Other, "failed to spawn conpty"))
}
@@ -123,12 +122,12 @@ impl OnResize for Pty {
}
}
-fn cmdline(config: &PtyConfig) -> String {
- let default_shell = Program::Just("powershell".to_owned());
+fn cmdline(config: &Options) -> String {
+ let default_shell = Shell::new("powershell".to_owned(), Vec::new());
let shell = config.shell.as_ref().unwrap_or(&default_shell);
- once(shell.program())
- .chain(shell.args().iter().map(|a| a.as_ref()))
+ once(shell.program.as_str())
+ .chain(shell.args.iter().map(|s| s.as_str()))
.collect::<Vec<_>>()
.join(" ")
}