zellij-org/zellij · error · anyhow

Invalid NestedSessionHandling value: {}

Error message

Invalid NestedSessionHandling value: {}

What it means

Error "Invalid NestedSessionHandling value: {}" thrown in zellij-org/zellij.

Source

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

                        .map_err(|e| anyhow!(e))
                })
                .transpose()?,
            nested_session_handling: options
                .nested_session_handling
                .map(|n| match ProtoNestedSessionHandling::try_from(n).ok() {
                    Some(ProtoNestedSessionHandling::Ask) => {
                        Ok(crate::input::options::NestedSessionHandling::Ask)
                    },
                    Some(ProtoNestedSessionHandling::Fullscreen) => {
                        Ok(crate::input::options::NestedSessionHandling::Fullscreen)
                    },
                    Some(ProtoNestedSessionHandling::Descend) => {
                        Ok(crate::input::options::NestedSessionHandling::Descend)
                    },
                    Some(ProtoNestedSessionHandling::Never) => {
                        Ok(crate::input::options::NestedSessionHandling::Never)
                    },
                    _ => Err(anyhow!("Invalid NestedSessionHandling value: {}", n)),
                })
                .transpose()?,
            explicit_theme_hue: options
                .explicit_theme_hue
                .map(|hue| {
                    use crate::client_server_contract::client_server_contract::ThemeHue as ProtoThemeHue;
                    match ProtoThemeHue::try_from(hue).ok() {
                        Some(ProtoThemeHue::Dark) => Ok(crate::data::ThemeHue::Dark),
                        Some(ProtoThemeHue::Light) => Ok(crate::data::ThemeHue::Light),
                        _ => Err(anyhow!("Invalid ThemeHue value: {}", hue)),
                    }
                })
                .transpose()?,
        })
    }
}

// Complete Action conversion implementation - all 91 variants

View on GitHub (pinned to e839bfffa5)

Solutions

  1. Validate the value against the allowed enum range before constructing the message.
  2. Ensure client and server use matching protobuf definitions; regenerate bindings if versions differ.
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Occurs when a protobuf enum value received over IPC has no matching variant; conversion rejects the unknown value.

Common situations: Typical of version skew between client and server, or a malformed/corrupted IPC message.


AI-assisted analysis of zellij-org/zellij@e839bfffa5 (2026-08-28). Data as JSON: /api/errors/ec23ab9b2671c6d6. Report an issue: GitHub.