Undo some changes

This commit is contained in:
Kunal Mohan 2021-02-13 15:57:31 +05:30
parent aef52b0690
commit 75b07cc6c8
2 changed files with 6 additions and 8 deletions

View File

@ -209,7 +209,7 @@ pub fn start(mut os_input: Box<dyn OsApi>, opts: CliArgs, config: Config) {
let send_app_instructions =
SenderWithContext::new(SenderType::SyncSender(send_app_instructions));
let ipc_thread = start_server(
let pty_thread = start_server(
os_input.clone(),
opts.clone(),
command_is_executing.clone(),
@ -566,7 +566,7 @@ pub fn start(mut os_input: Box<dyn OsApi>, opts: CliArgs, config: Config) {
}
AppInstruction::Error(backtrace) => {
let _ = send_server_instructions.send(ApiCommand::Quit);
let _ = ipc_thread.join();
let _ = pty_thread.join();
//IpcSenderWithContext::new().send(ApiCommand::Quit);
let _ = send_screen_instructions.send(ScreenInstruction::Quit);
let _ = screen_thread.join();
@ -595,7 +595,7 @@ pub fn start(mut os_input: Box<dyn OsApi>, opts: CliArgs, config: Config) {
}
let _ = send_server_instructions.send(ApiCommand::Quit);
let _ = ipc_thread.join().unwrap();
let _ = pty_thread.join().unwrap();
//IpcSenderWithContext::new().send(ApiCommand::Quit);
let _ = send_screen_instructions.send(ScreenInstruction::Quit);
screen_thread.join().unwrap();

View File

@ -110,7 +110,7 @@ pub fn start_server(
command_is_executing.done_closing_pane();
}
PtyInstruction::Quit => {
//break;
break;
}
}
}
@ -146,8 +146,6 @@ pub fn start_server(
}
}
}
//let _ = pty_thread.join();
}
})
.unwrap();
@ -160,10 +158,10 @@ fn handle_stream(
mut stream: LocalSocketStream,
km: u32,
) {
//let mut reader = BufReader::new(stream);
let mut reader = BufReader::new(stream);
let mut buffer = [0; 65535]; // TODO: more accurate
loop {
let bytes = stream
let bytes = reader
.read(&mut buffer)
.expect("failed to parse ipc message");
let (mut err_ctx, decoded): (ErrorContext, ApiCommand) =