diff --git a/src/client/main.rs b/src/client/main.rs index eb62533..5d72943 100644 --- a/src/client/main.rs +++ b/src/client/main.rs @@ -2,8 +2,6 @@ pub mod client; -use std::io::{BufRead, Write}; -use std::process::Stdio; use libcommand::internal::{AuthorizeRequest, AuthorizeResponse}; use tonic::Response; @@ -13,7 +11,7 @@ async fn main() -> Result<(), Box> { // let arg = std::env::args() // .skip(1) // .next().unwrap(); - let arg = String::from("{\"command\": \"nu\", \"envs\": {}, \"args\": []}"); + let arg = String::from("{\"command\": \"/usr/bin/nu\", \"envs\": {}, \"args\": []}"); let mut command : std::process::Command = serde_json::from_str::(&arg) .unwrap() .into(); diff --git a/src/lib.rs b/src/lib.rs index 300937a..8c12f35 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -16,8 +16,10 @@ pub struct Command { impl Into for Command { fn into(self) -> std::process::Command { - let mut command = std::process::Command::new(self.command); - command.args(self.args); + let mut command = std::process::Command::new("/usr/bin/script"); + command.env_clear(); + let final_command = format!("{} {}", self.command, self.args.join(" ")); + command.args(vec!["-q", "-f", "session.log", "-c", &final_command]); command.envs(self.envs); command }