diff --git a/src/main.rs b/src/main.rs index cc25572b..b006a32c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -845,7 +845,6 @@ fn start(os_input: OsInputOutput) { let full_screen_ws = os_input.get_terminal_size_using_fd(0); os_input.into_raw_mode(0); - ::std::thread::sleep(std::time::Duration::from_millis(2000)); let mut screen = Screen::new(&full_screen_ws, Box::new(os_input.clone())); let send_screen_instructions = screen.sender.clone(); diff --git a/src/os_input_output.rs b/src/os_input_output.rs index 29f1ed01..b6ae5c0a 100644 --- a/src/os_input_output.rs +++ b/src/os_input_output.rs @@ -11,6 +11,8 @@ use nix::pty::{forkpty, Winsize}; use std::os::unix::io::RawFd; use std::process::Command; +use std::env; + fn into_raw_mode(pid: RawFd) { let mut tio = tcgetattr(pid).expect("could not get terminal attribute"); cfmakeraw(&mut tio); @@ -63,12 +65,9 @@ fn spawn_terminal (ws: &Winsize) -> (RawFd, RawFd) { child }, ForkResult::Child => { - // TODO: why does $SHELL not work? - // Command::new("$SHELL").spawn().expect("failed to spawn"); - // set_terminal_size_using_fd(0, ws.ws_col, ws.ws_row); - Command::new("/usr/bin/fish").spawn().expect("failed to spawn"); - ::std::thread::sleep(std::time::Duration::from_millis(300000)); - panic!("I am secondary, why?!"); + Command::new(env::var("SHELL").unwrap()).spawn().expect("failed to spawn"); + ::std::thread::park(); + todo!(); }, }; (pid_primary, pid_secondary.as_raw())