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

ResizeByPaneId missing pane_id

Error message

ResizeByPaneId missing pane_id

What it means

ResizeByPaneId resizes one specific pane; its protobuf message ResizeByPaneIdAction carries optional pane_id and optional resize_action. The conversion checks resize_action first, then requires pane_id for the final Action construction. Hitting 'ResizeByPaneId missing pane_id' means resize_action was present and valid but pane_id was None, so the resize target is unknown and the action is dropped.

Source

Thrown at zellij-utils/src/ipc/protobuf_conversion.rs:2986

                    pane_id: a
                        .pane_id
                        .ok_or_else(|| anyhow!("HalfPageScrollDownByPaneId missing pane_id"))?
                        .try_into()?,
                })
            },
            ActionType::ResizeByPaneId(a) => {
                let resize_action = a
                    .resize_action
                    .ok_or_else(|| anyhow!("ResizeByPaneId missing resize_action"))?;
                let resize = proto_i32_to_resize(resize_action.resize)?;
                let direction = resize_action
                    .direction
                    .map(|d| proto_i32_to_direction(d))
                    .transpose()?;
                Ok(crate::input::actions::Action::ResizeByPaneId {
                    pane_id: a
                        .pane_id
                        .ok_or_else(|| anyhow!("ResizeByPaneId missing pane_id"))?
                        .try_into()?,
                    resize,
                    direction,
                })
            },
            ActionType::MovePaneByPaneId(a) => {
                let direction = a.direction.map(|d| proto_i32_to_direction(d)).transpose()?;
                Ok(crate::input::actions::Action::MovePaneByPaneId {
                    pane_id: a
                        .pane_id
                        .ok_or_else(|| anyhow!("MovePaneByPaneId missing pane_id"))?
                        .try_into()?,
                    direction,
                })
            },
            ActionType::MovePaneBackwardsByPaneId(a) => {
                Ok(crate::input::actions::Action::MovePaneBackwardsByPaneId {
                    pane_id: a

View on GitHub (pinned to 98a0837077)

Solutions

  1. Set pane_id: Some(PaneId { pane_type: Some(PaneType::Terminal(id)) }) together with resize_action.
  2. Use the plain Resize action when resizing the focused pane.
  3. Keep client, server, and plugins on one zellij version so both optional fields exist.
  4. Write a constructor function for resize actions that requires all fields, so incomplete messages cannot be built.

Example fix

// before
let action = ActionType::ResizeByPaneId(ResizeByPaneIdAction {
    pane_id: None, // -> "ResizeByPaneId missing pane_id"
    resize_action: Some(ResizeAction {
        resize: ResizeType::Increase as i32,
        direction: None,
    }),
});

// after
let action = ActionType::ResizeByPaneId(ResizeByPaneIdAction {
    pane_id: Some(PaneId { pane_type: Some(PaneType::Terminal(1)) }),
    resize_action: Some(ResizeAction {
        resize: ResizeType::Increase as i32,
        direction: None,
    }),
});
Defensive patterns

Strategy: validation

Validate before calling

fn is_sendable(a: &ResizeByPaneIdAction) -> bool {
    a.pane_id
        .as_ref()
        .and_then(|p| p.pane_type.as_ref())
        .is_some()
        && a.resize_action.is_some()
}

Type guard

fn has_valid_pane_id(a: &ResizeByPaneIdAction) -> bool {
    matches!(
        a.pane_id.as_ref().and_then(|p| p.pane_type.as_ref()),
        Some(pane_id::PaneType::Terminal(_)) | Some(pane_id::PaneType::Plugin(_))
    )
}

Try / catch

match Action::try_from(proto_action) {
    Ok(action) => dispatch(action),
    Err(e) if e.to_string().contains("ResizeByPaneId missing pane_id") => {
        log::warn!("resize without target pane: {e}");
    },
    Err(e) => return Err(e),
}

Prevention

When it happens

Trigger: An action message with action_type = ResizeByPaneId, a populated resize_action, but ResizeByPaneIdAction.pane_id = None.

Common situations: Hand-built resize actions where the author focused on the resize parameters and forgot the target; clients built from a contract where pane_id was not yet optional-aware; intending the focused-pane Resize variant instead.

Related errors


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