fix: shell/sleep stuff

This commit is contained in:
Aram Drevekenin 2020-08-22 13:59:15 +02:00
parent 28593b7348
commit 91f172588c
2 changed files with 5 additions and 7 deletions

View file

@ -845,7 +845,6 @@ fn start(os_input: OsInputOutput) {
let full_screen_ws = os_input.get_terminal_size_using_fd(0); let full_screen_ws = os_input.get_terminal_size_using_fd(0);
os_input.into_raw_mode(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 mut screen = Screen::new(&full_screen_ws, Box::new(os_input.clone()));
let send_screen_instructions = screen.sender.clone(); let send_screen_instructions = screen.sender.clone();

View file

@ -11,6 +11,8 @@ use nix::pty::{forkpty, Winsize};
use std::os::unix::io::RawFd; use std::os::unix::io::RawFd;
use std::process::Command; use std::process::Command;
use std::env;
fn into_raw_mode(pid: RawFd) { fn into_raw_mode(pid: RawFd) {
let mut tio = tcgetattr(pid).expect("could not get terminal attribute"); let mut tio = tcgetattr(pid).expect("could not get terminal attribute");
cfmakeraw(&mut tio); cfmakeraw(&mut tio);
@ -63,12 +65,9 @@ fn spawn_terminal (ws: &Winsize) -> (RawFd, RawFd) {
child child
}, },
ForkResult::Child => { ForkResult::Child => {
// TODO: why does $SHELL not work? Command::new(env::var("SHELL").unwrap()).spawn().expect("failed to spawn");
// Command::new("$SHELL").spawn().expect("failed to spawn"); ::std::thread::park();
// set_terminal_size_using_fd(0, ws.ws_col, ws.ws_row); todo!();
Command::new("/usr/bin/fish").spawn().expect("failed to spawn");
::std::thread::sleep(std::time::Duration::from_millis(300000));
panic!("I am secondary, why?!");
}, },
}; };
(pid_primary, pid_secondary.as_raw()) (pid_primary, pid_secondary.as_raw())