From a6431cb75b72f8c3394065189d5639bad68f43f1 Mon Sep 17 00:00:00 2001 From: Dongdong Zhou Date: Mon, 18 Oct 2021 14:24:23 +0100 Subject: [PATCH] shell login --- proxy/src/terminal.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/proxy/src/terminal.rs b/proxy/src/terminal.rs index e947a065..56614183 100644 --- a/proxy/src/terminal.rs +++ b/proxy/src/terminal.rs @@ -9,10 +9,11 @@ use alacritty_terminal::{ ansi, + config::Program, event::OnResize, event_loop::Msg, term::SizeInfo, - tty::{self, EventedPty, EventedReadWrite}, + tty::{self, setup_env, EventedPty, EventedReadWrite}, }; use mio::{ channel::{channel, Receiver, Sender}, @@ -68,6 +69,11 @@ pub fn new( let poll = mio::Poll::new().unwrap(); let mut config = TermConfig::default(); config.working_directory = cwd; + config.shell = std::env::var("SHELL").ok().map(|shell| Program::WithArgs { + program: shell.to_string(), + args: vec!["-l".to_string()], + }); + setup_env(&config); let size = SizeInfo::new(width as f32, height as f32, 1.0, 1.0, 0.0, 0.0, true); let mut pty = alacritty_terminal::tty::new(&config, &size, None);