Skip to content

Commit

Permalink
fix(terminal): repeat instruction sending on error (zellij-org#3372)
Browse files Browse the repository at this point in the history
This ended up breaking sixel support as screen instructions such as
  pixel dimension detection response were unreliably replayed when
  the screen was not yet ready.
  • Loading branch information
lypanov committed Jul 18, 2024
1 parent f6ec1a1 commit f24f715
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion zellij-server/src/route.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f24f715

Please sign in to comment.