zellij-org/zellij · warning
Swap Layout not found for: {}
Error message
Swap Layout not found for: {} What it means
Returned by dump_specified_swap_layout when the requested swap-layout name is not one of the four built-ins: strider, default, compact, classic. The function can only dump assets compiled into the binary, so any other name (including a custom swap layout on disk) fails.
Source
Thrown at zellij-utils/src/setup.rs:202
let content = fs::read_to_string(path)?;
std::io::stdout().write_all(content.as_bytes())
},
_ => {
log::error!("No layout named {custom} found");
return Ok(());
},
}
},
}
}
pub fn dump_specified_swap_layout(swap_layout: &str) -> std::io::Result<()> {
match swap_layout {
"strider" => dump_asset(STRIDER_SWAP_LAYOUT),
"default" => dump_asset(DEFAULT_SWAP_LAYOUT),
"compact" => dump_asset(COMPACT_BAR_SWAP_LAYOUT),
"classic" => dump_asset(CLASSIC_SWAP_LAYOUT),
not_found => Err(std::io::Error::new(
std::io::ErrorKind::Other,
format!("Swap Layout not found for: {}", not_found),
)),
}
}
#[cfg(not(target_family = "wasm"))]
pub fn dump_builtin_plugins(path: &PathBuf) -> Result<()> {
for (asset_path, bytes) in ASSET_MAP.iter() {
let plugin_path = path.join(asset_path);
plugin_path
.parent()
.with_context(|| {
format!(
"failed to acquire parent path of '{}'",
plugin_path.display()
)
})View on GitHub (pinned to 98a0837077)
Solutions
- Use one of the four supported names exactly: default, compact, classic, strider
- For custom swap layouts, read them from your layout directory instead of the dump command
- Check `zellij setup --check` output for where custom layouts live
Defensive patterns
Strategy: validation
Validate before calling
const BUILTIN_SWAP_LAYOUTS: &[&str] = &["strider", "default", "compact", "classic"];
fn swap_layout_is_builtin(name: &str) -> bool {
BUILTIN_SWAP_LAYOUTS.contains(&name)
} Type guard
fn is_builtin_swap_layout(name: &str) -> bool {
matches!(name, "strider" | "default" | "compact" | "classic")
} Prevention
- Restrict dump requests to the four compiled-in names: default, compact, classic, strider
- Custom swap layouts belong in the layout directory, not the asset dump path
- Tab-complete or validate names in wrapper scripts to avoid typos
When it happens
Trigger: Passing a name other than strider/default/compact/classic to the setup option that dumps a swap layout (e.g. `zellij setup --dump-swap-layout <name>`), including typos and custom layout names.
Common situations: Users expecting `--dump-swap-layout` to work for layouts installed in the layout directory; typos like 'clasIC' or 'compac'; scripts written against a fork with extra bundled layouts.
Related errors
- The layout was not found
- either '--build' or '--test' must be provided!
- flags '--build' and '--test' are mutually exclusive!
- !!! cargo make has been deprecated by zellij !!! Our build
- flag '--no-push' can only be used with '--cargo-registry'
AI-assisted analysis of zellij-org/zellij@98a0837077 (2026-08-16).
Data as JSON: /api/errors/4f7d6f6eb725c220.
Report an issue: GitHub.