From 5b079f6d437c567a1533a719194f6e579a7eedae Mon Sep 17 00:00:00 2001 From: Justin Charette Date: Sat, 1 Apr 2017 19:30:29 -0400 Subject: Do not replace $SHELL with --command option Signed-off-by: Justin Charette --- src/tty.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/tty.rs') diff --git a/src/tty.rs b/src/tty.rs index 39d3deea..7623abdc 100644 --- a/src/tty.rs +++ b/src/tty.rs @@ -188,12 +188,13 @@ pub fn new(config: &Config, options: &Options, size: T) -> Pty { let (master, slave) = openpty(win.ws_row as _, win.ws_col as _); let default_shell = &Shell::new(pw.shell); - let shell = options.shell() - .or_else(|| config.shell()) + let shell = config.shell() .unwrap_or(&default_shell); - let mut builder = Command::new(shell.program()); - for arg in shell.args() { + let initial_command = options.command().unwrap_or(&shell); + + let mut builder = Command::new(initial_command.program()); + for arg in initial_command.args() { builder.arg(arg); } -- cgit