aboutsummaryrefslogtreecommitdiff
path: root/src/tty.rs
diff options
context:
space:
mode:
authorNiklas Claesson <nicke.claesson@gmail.com>2017-01-25 00:19:45 +0100
committerJoe Wilm <jwilm@users.noreply.github.com>2017-01-28 12:25:57 -0800
commit019daa8b69b2e3b402362b71eeb3c8408c2ab933 (patch)
tree083a05743781e19003bddf9f429923decfa78491 /src/tty.rs
parent08f348ecea0b782cd8539850abe6309d0e5b06c9 (diff)
downloadalacritty-019daa8b69b2e3b402362b71eeb3c8408c2ab933.tar.gz
alacritty-019daa8b69b2e3b402362b71eeb3c8408c2ab933.zip
Add support for -e argument
Diffstat (limited to 'src/tty.rs')
-rw-r--r--src/tty.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/tty.rs b/src/tty.rs
index 99f1239e..4fcf065f 100644
--- a/src/tty.rs
+++ b/src/tty.rs
@@ -26,6 +26,7 @@ use libc::{self, winsize, c_int, pid_t, WNOHANG, WIFEXITED, WEXITSTATUS, SIGCHLD
use term::SizeInfo;
use display::OnResize;
use config::{Config, Shell};
+use cli::Options;
/// Process ID of child process
///
@@ -179,15 +180,17 @@ fn get_pw_entry(buf: &mut [i8; 1024]) -> Passwd {
}
/// Create a new tty and return a handle to interact with it.
-pub fn new<T: ToWinsize>(config: &Config, size: T) -> Pty {
+pub fn new<T: ToWinsize>(config: &Config, options: &Options, size: T) -> Pty {
let win = size.to_winsize();
let mut buf = [0; 1024];
let pw = get_pw_entry(&mut buf);
let (master, slave) = openpty(win.ws_row as _, win.ws_col as _);
- let default_shell = Shell::new(pw.shell);
- let shell = config.shell().unwrap_or(&default_shell);
+ let default_shell = &Shell::new(pw.shell);
+ let shell = options.shell()
+ .or_else(|| config.shell())
+ .unwrap_or(&default_shell);
let mut builder = Command::new(shell.program());
for arg in shell.args() {