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

Failed to deserialize layout

Error message

Failed to deserialize layout: {}

What it means

Error "Failed to deserialize layout: {}" thrown in zellij-org/zellij.

Solutions

  1. Check the attached error for the underlying serialization failure and fix the offending data.
  2. Ensure plugin/wasm artifacts and zellij versions are compatible.

When it happens

Trigger: Occurs at zellij-server/src/plugins/zellij_exports.rs:2965 when the operation fails: "Failed to deserialize layout: {}". Currently there is no defensive handling preventing or contextualizing this failure before it surfaces.

Common situations: Typically version skew, corrupted data, or an unexpected payload shape.


AI-assisted analysis of zellij-org/zellij@5cb5df5cce (2026-08-19). Data as JSON: /api/errors/2c96861034841a82. Report an issue: GitHub.

Appendix: source

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

    let error_msg = || format!("Failed to detach");
    apply_action!(action, error_msg, env);
}

fn switch_session(
    env: &PluginEnv,
    session_name: Option<String>,
    tab_position: Option<usize>,
    pane_id: Option<(u32, bool)>,
    layout: Option<LayoutInfo>,
    cwd: Option<PathBuf>,
) -> Result<()> {
    // pane_id is (id, is_plugin)
    let err_context = || format!("Failed to switch session");
    if let Some(LayoutInfo::Stringified(stringified_layout)) = layout.as_ref() {
        // we verify the stringified layout here to fail early rather than when parsing it at the
        // session-switching phase
        if let Err(e) = Layout::from_kdl(&stringified_layout, None, None, None) {
            return Err(anyhow!("Failed to deserialize layout: {}", e));
        }
    }

    let (completion_tx, completion_rx) = oneshot::channel();

    if session_name
        .as_ref()
        .map(|s| s.contains('/'))
        .unwrap_or(false)
    {
        log::error!("Session names cannot contain \'/\'");
    } else {
        let client_id = env.client_id;
        let tab_position = tab_position.map(|p| p + 1); // ¯\_()_/¯
        let cwd = cwd
            .map(|c| translate_plugin_path(env, c))
            .or_else(|| Some(env.plugin_cwd.clone()));
        let connect_to_session = ConnectToSession {

View on GitHub (pinned to 5cb5df5cce)