summaryrefslogtreecommitdiff
path: root/alacritty_terminal/src/tty/unix.rs
diff options
context:
space:
mode:
authorKirill Chibisov <contact@kchibisov.com>2020-06-05 01:10:31 +0300
committerGitHub <noreply@github.com>2020-06-05 01:10:31 +0300
commitf99220f01553c6c9d36e1f4ce01c007f4d4d4cb5 (patch)
treea61843b8ffe5fc25cc3a35157bc1a4346f37d40b /alacritty_terminal/src/tty/unix.rs
parent1e32e5a5154a2e765ca0b3ab8e50e4c01bbe5d18 (diff)
downloadalacritty-f99220f01553c6c9d36e1f4ce01c007f4d4d4cb5.tar.gz
alacritty-f99220f01553c6c9d36e1f4ce01c007f4d4d4cb5.zip
Refactor Shell, Command, and Launcher to share impl
Diffstat (limited to 'alacritty_terminal/src/tty/unix.rs')
-rw-r--r--alacritty_terminal/src/tty/unix.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/alacritty_terminal/src/tty/unix.rs b/alacritty_terminal/src/tty/unix.rs
index 2db59519..2c2f4eee 100644
--- a/alacritty_terminal/src/tty/unix.rs
+++ b/alacritty_terminal/src/tty/unix.rs
@@ -14,7 +14,7 @@
//
//! TTY related functionality.
-use crate::config::{Config, Shell};
+use crate::config::{Config, Program};
use crate::event::OnResize;
use crate::term::SizeInfo;
use crate::tty::{ChildEvent, EventedPty, EventedReadWrite};
@@ -163,14 +163,14 @@ pub fn new<C>(config: &Config<C>, size: &SizeInfo, window_id: Option<usize>) ->
let shell_name = pw.shell.rsplit('/').next().unwrap();
let argv = vec![String::from("-c"), format!("exec -a -{} {}", shell_name, pw.shell)];
- Shell::new_with_args("/bin/bash", argv)
+ Program::WithArgs { program: "/bin/bash".to_owned(), args: argv }
} else {
- Shell::new(pw.shell)
+ Program::Just(pw.shell.to_owned())
};
let shell = config.shell.as_ref().unwrap_or(&default_shell);
- let mut builder = Command::new(&*shell.program);
- for arg in &shell.args {
+ let mut builder = Command::new(&*shell.program());
+ for arg in shell.args() {
builder.arg(arg);
}
@@ -246,7 +246,7 @@ pub fn new<C>(config: &Config<C>, size: &SizeInfo, window_id: Option<usize>) ->
pty.on_resize(size);
pty
},
- Err(err) => die!("Failed to spawn command '{}': {}", shell.program, err),
+ Err(err) => die!("Failed to spawn command '{}': {}", shell.program(), err),
}
}