diff --git a/src/common/errors.rs b/src/common/errors.rs index 37b3a2c7d..3b5c83543 100644 --- a/src/common/errors.rs +++ b/src/common/errors.rs @@ -314,18 +314,9 @@ pub enum OsContext { impl From<&OsApiInstruction> for OsContext { fn from(os_instruction: &OsApiInstruction) -> Self { match *os_instruction { - OsApiInstruction::SpawnTerminal(_) => OsContext::SpawnTerminal, - OsApiInstruction::GetTerminalSizeUsingFd(_) => OsContext::GetTerminalSizeUsingFd, OsApiInstruction::SetTerminalSizeUsingFd(_, _, _) => OsContext::SetTerminalSizeUsingFd, - OsApiInstruction::SetRawMode(_) => OsContext::SetRawMode, - OsApiInstruction::UnsetRawMode(_) => OsContext::UnsetRawMode, - OsApiInstruction::ReadFromTtyStdout(_, _) => OsContext::ReadFromTtyStdout, OsApiInstruction::WriteToTtyStdin(_, _) => OsContext::WriteToTtyStdin, OsApiInstruction::TcDrain(_) => OsContext::TcDrain, - OsApiInstruction::Kill(_) => OsContext::Kill, - OsApiInstruction::ReadFromStdin => OsContext::ReadFromStdin, - OsApiInstruction::GetStdoutWriter => OsContext::GetStdoutWriter, - OsApiInstruction::BoxClone => OsContext::BoxClone } } } diff --git a/src/common/os_input_output.rs b/src/common/os_input_output.rs index 8a8cea144..0e7363ea8 100644 --- a/src/common/os_input_output.rs +++ b/src/common/os_input_output.rs @@ -271,18 +271,9 @@ impl OsApi for OsInputOutput { #[derive(Serialize, Deserialize, Debug, Clone)] pub enum OsApiInstruction { - GetTerminalSizeUsingFd(RawFd), SetTerminalSizeUsingFd(RawFd, u16, u16), - SetRawMode(RawFd), - UnsetRawMode(RawFd), - SpawnTerminal(Option), - ReadFromTtyStdout(RawFd, Vec), WriteToTtyStdin(RawFd, Vec), TcDrain(RawFd), - Kill(RawFd), - ReadFromStdin, - GetStdoutWriter, - BoxClone } impl Clone for Box { diff --git a/src/server/mod.rs b/src/server/mod.rs index 3ca9e0043..c17139183 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -131,25 +131,9 @@ pub fn start_server(os_input: Box, opts: CliArgs) -> (thread::JoinHan .expect("failed to receive an event on the channel"); err_ctx.add_call(ContextType::Os(OsContext::from(&event))); match event { - OsApiInstruction::SpawnTerminal(file_to_open) => { - os_input.spawn_terminal(file_to_open); - } - OsApiInstruction::GetTerminalSizeUsingFd(fd) => { - os_input.get_terminal_size_using_fd(fd); - } OsApiInstruction::SetTerminalSizeUsingFd(fd, cols, rows) => { os_input.set_terminal_size_using_fd(fd, cols, rows); } - OsApiInstruction::SetRawMode(fd) => { - os_input.set_raw_mode(fd); - } - OsApiInstruction::UnsetRawMode(fd) => { - os_input.unset_raw_mode(fd); - } - OsApiInstruction::ReadFromTtyStdout(fd, mut buf) => { - let slice = buf.as_mut_slice(); - os_input.read_from_tty_stdout(fd, slice).unwrap(); - } OsApiInstruction::WriteToTtyStdin(fd, mut buf) => { let slice = buf.as_mut_slice(); os_input.write_to_tty_stdin(fd, slice).unwrap(); @@ -157,18 +141,6 @@ pub fn start_server(os_input: Box, opts: CliArgs) -> (thread::JoinHan OsApiInstruction::TcDrain(fd) => { os_input.tcdrain(fd).unwrap(); } - OsApiInstruction::Kill(pid) => { - os_input.kill(pid).unwrap(); - } - OsApiInstruction::ReadFromStdin => { - os_input.read_from_stdin(); - } - OsApiInstruction::GetStdoutWriter => { - os_input.get_stdout_writer(); - } - OsApiInstruction::BoxClone => { - os_input.box_clone(); - } } } })