zellij-org/zellij · warning · anyhow::Error

Failed to serialize pane scrollback response: {}

Error message

Failed to serialize pane scrollback response: {}

What it means

After retrieving pane scrollback (via a oneshot to the screen thread), the response is converted to ProtobufPaneScrollbackResponse and written to the plugin's WASI channel. This non-fatal error means that conversion failed, so the plugin never receives the scrollback payload — it typically indicates an internal proto/struct mismatch rather than bad user input.

Source

Thrown at zellij-server/src/plugins/zellij_exports.rs:4190

                pane_id
            ))
        },
        Err(RecvTimeoutError::Disconnected) => {
            log::error!(
                "GetPaneScrollback channel disconnected for plugin {} requesting pane {:?}",
                env.plugin_id,
                pane_id
            );
            PaneScrollbackResponse::Err(format!(
                "Channel disconnected while retrieving scrollback for pane {:?}",
                pane_id
            ))
        },
    };

    // Convert to protobuf and write back to plugin
    ProtobufPaneScrollbackResponse::try_from(response)
        .map_err(|e| anyhow!("Failed to serialize pane scrollback response: {}", e))
        .and_then(|serialized| {
            wasi_write_object(env, &serialized.encode_to_vec())?;
            Ok(())
        })
        .with_context(err_context)
        .non_fatal();
}

fn write_to_pane_id(env: &PluginEnv, bytes: Vec<u8>, pane_id: PaneId) {
    let (completion_tx, completion_rx) = oneshot::channel();
    let send_result = env.senders.send_to_screen(ScreenInstruction::WriteToPaneId(
        bytes,
        pane_id,
        Some(NotificationEnd::new(completion_tx)),
    ));
    if send_result.is_ok() {
        let wait_forever = false;
        let _ = wait_for_action_completion(completion_rx, "write_to_pane_id", wait_forever);

View on GitHub (pinned to 98a0837077)

Solutions

  1. Clean-rebuild/reinstall zellij so the generated protobuf types match the server code
  2. Check the logged {} detail for which field failed
  3. Retry after clearing unusually large/old scrollback (e.g. clear pane history) if content size is implicated
  4. Report upstream with the payload detail if it reproduces on a stock build
Defensive patterns

Strategy: try-catch

Try / catch

ProtobufPaneScrollbackResponse::try_from(response)
    .map_err(|e| anyhow!("Failed to serialize pane scrollback response: {e}"))
    .and_then(|s| wasi_write_object(env, &s.encode_to_vec()).map_err(Into::into))
    .with_context(err_context)
    .non_fatal();

Prevention

When it happens

Trigger: The retrieved response (Ok(scrollback lines) or Err(message)) fails TryInto<ProtobufPaneScrollbackResponse> — e.g. after version drift between the server structs and generated protobuf types.

Common situations: Partial rebuild or mixed-version install where protobuf codegen is stale; scrollback content that the proto conversion cannot represent.

Related errors


AI-assisted analysis of zellij-org/zellij@98a0837077 (2026-08-16). Data as JSON: /api/errors/3193d3faf46b301a. Report an issue: GitHub.