tracks term then restore with vt100
This commit is contained in:
7 files changed
+286
-149
No files matched your search
@@ -321,7 +321,7 @@ async fn handle_operator_terminal_socket(
|
||||
return;
|
||||
}
|
||||
};
|
||||
let (mut outbound, replay) = match state
|
||||
let mut outbound = match state
|
||||
.terminals
|
||||
.attach_operator(&terminal_id, &attachment_token)
|
||||
.await
|
||||
@@ -333,14 +333,14 @@ async fn handle_operator_terminal_socket(
|
||||
}
|
||||
};
|
||||
info!(terminal_id, "operator terminal socket attached");
|
||||
let refresh = serde_json::to_string(&TerminalControl::Refresh)
|
||||
.expect("terminal refresh control serializes");
|
||||
let snapshot = serde_json::to_string(&TerminalControl::Snapshot)
|
||||
.expect("terminal snapshot control serializes");
|
||||
if let Err(code) = state
|
||||
.terminals
|
||||
.relay_to_agent(&terminal_id, TerminalRelayFrame::Text(refresh))
|
||||
.relay_to_agent(&terminal_id, TerminalRelayFrame::Text(snapshot))
|
||||
.await
|
||||
{
|
||||
warn!(terminal_id, code, "failed to request terminal redraw");
|
||||
warn!(terminal_id, code, "failed to request terminal snapshot");
|
||||
}
|
||||
let summary = state.terminals.summary(&terminal_id).await;
|
||||
if let Some((agent_id, _, _, _)) = &summary {
|
||||
@@ -371,12 +371,6 @@ async fn handle_operator_terminal_socket(
|
||||
return;
|
||||
}
|
||||
}
|
||||
for frame in replay {
|
||||
if send_relay_frame(&mut write, frame).await.is_err() {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
let mut explicit_close = false;
|
||||
loop {
|
||||
tokio::select! {
|
||||
@@ -657,7 +651,7 @@ mod tests {
|
||||
let ready = serde_json::to_string(&TerminalControl::Ready).expect("ready json");
|
||||
assert!(operator_relay_frame(Message::Text(ready.into())).is_err());
|
||||
|
||||
let refresh = serde_json::to_string(&TerminalControl::Refresh).expect("refresh json");
|
||||
assert!(operator_relay_frame(Message::Text(refresh.into())).is_err());
|
||||
let snapshot = serde_json::to_string(&TerminalControl::Snapshot).expect("snapshot json");
|
||||
assert!(operator_relay_frame(Message::Text(snapshot.into())).is_err());
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user