shell login

This commit is contained in:
Dongdong Zhou 2021-10-18 14:24:23 +01:00
parent a6badfd311
commit a6431cb75b
1 changed files with 7 additions and 1 deletions

View File

@ -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);