diff options
Diffstat (limited to 'alacritty_terminal/src/tty/windows/winpty.rs')
-rw-r--r-- | alacritty_terminal/src/tty/windows/winpty.rs | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/alacritty_terminal/src/tty/windows/winpty.rs b/alacritty_terminal/src/tty/windows/winpty.rs index 7aa976ee..8795ca6d 100644 --- a/alacritty_terminal/src/tty/windows/winpty.rs +++ b/alacritty_terminal/src/tty/windows/winpty.rs @@ -27,7 +27,7 @@ use winapi::um::winbase::FILE_FLAG_OVERLAPPED; use winpty::Config as WinptyConfig; use winpty::{ConfigFlags, MouseMode, SpawnConfig, SpawnFlags, Winpty}; -use crate::config::{Config, Options, Shell}; +use crate::config::{Config, Shell}; use crate::display::OnResize; use crate::term::SizeInfo; @@ -75,12 +75,7 @@ impl<'a> Drop for Agent<'a> { /// This is a placeholder value until we see how often long responses happen const AGENT_TIMEOUT: u32 = 10000; -pub fn new<'a>( - config: &Config, - options: &Options, - size: &SizeInfo, - _window_id: Option<usize>, -) -> Pty<'a> { +pub fn new<'a>(config: &Config, size: &SizeInfo, _window_id: Option<usize>) -> Pty<'a> { // Create config let mut wconfig = WinptyConfig::new(ConfigFlags::empty()).unwrap(); @@ -94,13 +89,12 @@ pub fn new<'a>( // Get process commandline let default_shell = &Shell::new("powershell"); - let shell = config.shell().unwrap_or(default_shell); - let initial_command = options.command().unwrap_or(shell); - let mut cmdline = initial_command.args().to_vec(); - cmdline.insert(0, initial_command.program().into()); + let shell = config.shell.as_ref().unwrap_or(default_shell); + let mut cmdline = shell.args.clone(); + cmdline.insert(0, shell.program.to_string()); // Warning, here be borrow hell - let cwd = options.working_dir.as_ref().map(|dir| canonicalize(dir).unwrap()); + let cwd = config.working_directory().as_ref().map(|dir| canonicalize(dir).unwrap()); let cwd = cwd.as_ref().map(|dir| dir.to_str().unwrap()); // Spawn process |