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

Invalid InputMode value

Error message

Invalid InputMode value: {}

What it means

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

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.

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-19). Data as JSON: /api/errors/06d60f48e431ac62. Report an issue: GitHub.

Appendix: source

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

}

fn proto_i32_to_input_mode(i: i32) -> Result<InputMode> {
    match ProtoInputMode::try_from(i).ok() {
        Some(ProtoInputMode::Normal) => Ok(InputMode::Normal),
        Some(ProtoInputMode::Locked) => Ok(InputMode::Locked),
        Some(ProtoInputMode::Resize) => Ok(InputMode::Resize),
        Some(ProtoInputMode::Pane) => Ok(InputMode::Pane),
        Some(ProtoInputMode::Tab) => Ok(InputMode::Tab),
        Some(ProtoInputMode::Scroll) => Ok(InputMode::Scroll),
        Some(ProtoInputMode::EnterSearch) => Ok(InputMode::EnterSearch),
        Some(ProtoInputMode::Search) => Ok(InputMode::Search),
        Some(ProtoInputMode::RenameTab) => Ok(InputMode::RenameTab),
        Some(ProtoInputMode::RenamePane) => Ok(InputMode::RenamePane),
        Some(ProtoInputMode::Session) => Ok(InputMode::Session),
        Some(ProtoInputMode::Move) => Ok(InputMode::Move),
        Some(ProtoInputMode::Prompt) => Ok(InputMode::Prompt),
        Some(ProtoInputMode::Tmux) => Ok(InputMode::Tmux),
        _ => Err(anyhow!("Invalid InputMode value: {}", i)),
    }
}

// Additional helper functions for Action conversion
fn resize_to_proto_i32(resize: crate::data::Resize) -> i32 {
    use crate::client_server_contract::client_server_contract::ResizeType;
    match resize {
        crate::data::Resize::Increase => ResizeType::Increase as i32,
        crate::data::Resize::Decrease => ResizeType::Decrease as i32,
    }
}

fn direction_to_proto_i32(direction: crate::data::Direction) -> i32 {
    use crate::client_server_contract::client_server_contract::Direction as ProtoDirection;
    match direction {
        crate::data::Direction::Left => ProtoDirection::Left as i32,
        crate::data::Direction::Right => ProtoDirection::Right as i32,
        crate::data::Direction::Up => ProtoDirection::Up as i32,

View on GitHub (pinned to e839bfffa5)