diff --git a/zellij-server/src/route.rs b/zellij-server/src/route.rs index 3092310ad7..ff53ee3d2e 100644 --- a/zellij-server/src/route.rs +++ b/zellij-server/src/route.rs @@ -1180,13 +1180,16 @@ pub(crate) fn route_thread_main( } Ok(should_break) }; + let mut repeat_retries = VecDeque::new(); while let Some(instruction_to_retry) = retry_queue.pop_front() { log::warn!("Server ready, retrying sending instruction."); - let should_break = handle_instruction(instruction_to_retry, None)?; + let should_break = handle_instruction(instruction_to_retry, Some(&mut repeat_retries))?; if should_break { break 'route_loop; } } + // retry on loop around + retry_queue.append(&mut repeat_retries); let should_break = handle_instruction(instruction, Some(&mut retry_queue))?; if should_break { break 'route_loop;