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

ResizeByPaneId missing resize_action

Error message

ResizeByPaneId missing resize_action

What it means

ResizeByPaneId resizes one specific pane, and its protobuf message ResizeByPaneIdAction carries two optional payloads: pane_id and resize_action (a ResizeAction with a required resize: ResizeType enum and optional direction: Direction). The conversion reads resize_action first; if it is None the conversion fails immediately with 'ResizeByPaneId missing resize_action', even when pane_id is set.

Source

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

                Ok(crate::input::actions::Action::HalfPageScrollUpByPaneId {
                    pane_id: a
                        .pane_id
                        .ok_or_else(|| anyhow!("HalfPageScrollUpByPaneId missing pane_id"))?
                        .try_into()?,
                })
            },
            ActionType::HalfPageScrollDownByPaneId(a) => {
                Ok(crate::input::actions::Action::HalfPageScrollDownByPaneId {
                    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

View on GitHub (pinned to 98a0837077)

Solutions

  1. Set resize_action: Some(ResizeAction { resize: ResizeType::Increase as i32, direction: Some(Direction::Left as i32) }) alongside pane_id.
  2. Ensure the resize enum value you send is a valid ResizeType (not Unspecified/0) or the next conversion step (proto_i32_to_resize) will also fail.
  3. Use the plain Resize variant when targeting the focused pane.
  4. Rebuild client and plugins against the same zellij release.

Example fix

// before
let action = ActionType::ResizeByPaneId(ResizeByPaneIdAction {
    pane_id: Some(PaneId { pane_type: Some(PaneType::Terminal(1)) }),
    resize_action: None, // -> "ResizeByPaneId missing resize_action"
});

// 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: Some(Direction::Left as i32),
    }),
});
Defensive patterns

Strategy: validation

Validate before calling

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

Type guard

fn is_valid_resize(a: &ResizeByPaneIdAction) -> bool {
    match (a.pane_id.as_ref().and_then(|p| p.pane_type.as_ref()), a.resize_action.as_ref()) {
        (Some(pane_id::PaneType::Terminal(_)) | Some(pane_id::PaneType::Plugin(_)), Some(r)) => {
            ResizeType::try_from(r.resize).is_ok()
        },
        _ => false,
    }
}

Try / catch

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

Prevention

When it happens

Trigger: Sending ActionType::ResizeByPaneId whose inner ResizeByPaneIdAction has resize_action: None - e.g. filling only pane_id and forgetting the resize payload, or constructing the struct with default().

Common situations: Plugins or CLI wrappers building resize actions by hand; version skew where an older client's ResizeByPaneIdAction lacks the resize_action field; migrating from the focused-pane Resize action which carries the payload at a different level.

Related errors


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