aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAram Drevekenin <aram@poor.dev>2020-08-22 13:59:15 +0200
committerAram Drevekenin <aram@poor.dev>2020-08-22 13:59:15 +0200
commit91f172588c20e2ea1532c77cb8c8402cd0919c99 (patch)
tree5e48b39b6c14b1b8ea228bc9e0eb1bd4ea5dd919
parentos_input_output (diff)
downloadsl0ppij-91f172588c20e2ea1532c77cb8c8402cd0919c99.tar.gz
sl0ppij-91f172588c20e2ea1532c77cb8c8402cd0919c99.tar.xz
sl0ppij-91f172588c20e2ea1532c77cb8c8402cd0919c99.zip
fix: shell/sleep stuff
-rw-r--r--src/main.rs1
-rw-r--r--src/os_input_output.rs11
2 files changed, 5 insertions, 7 deletions
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())