sxyazi/yazi · error

either name or interactive must be specified in…

Error message

either name or interactive must be specified in TabRenameForm

What it means

TabRenameForm requires at least one rename mode: either an explicit `name` for the new tab title or `interactive = true` to prompt for it. The TryFrom<ActionCow> deserializer validates this after deserializing the action payload and bails if both are absent, because a rename action with neither would be a no-op.

Solutions

  1. Pass a `name` string, e.g. `tab_rename({ name = 'build' })`
  2. Or set `interactive = true` to open an interactive rename prompt: `tab_rename({ interactive = true })`
  3. Check for field-name typos in the payload table

Example fix

// before
Manager:tab_rename({})
// after
Manager:tab_rename({ interactive = true })
Defensive patterns

Strategy: validation

Validate before calling

local opts = opts or {}
assert(opts.name or opts.interactive, "tab_rename requires 'name' or interactive = true")
Manager:tab_rename(opts)

Type guard

local function is_valid_rename_opts(opts)
  return type(opts) == "table" and (type(opts.name) == "string" or opts.interactive == true)
end

Prevention

When it happens

Trigger: Sending a `tab_rename` action (e.g. via `ya emit` / plugin Manager action call) with neither `name` nor `interactive` set, e.g. `Manager:tab_rename({})` or emitting the action with only unrelated fields.

Common situations: Plugin authors writing custom keymaps that pass an empty table to tab_rename; typos in the field name (`nam = ...` or `interactiv = true`) so both fields deserialize as None/false.

Related errors


AI-assisted analysis of sxyazi/yazi@5f901b886b (2026-09-02). Data as JSON: /api/errors/581034239cf080f4. Report an issue: GitHub.

Appendix: source

Thrown at yazi-parser/src/mgr/tab_rename.rs:22

use yazi_shared::event::ActionCow;
use yazi_shim::SStr;

#[derive(Debug, Deserialize)]
pub struct TabRenameForm {
	#[serde(alias = "0")]
	pub name:        Option<SStr>,
	#[serde(default)]
	pub interactive: bool,
}

impl TryFrom<ActionCow> for TabRenameForm {
	type Error = anyhow::Error;

	fn try_from(a: ActionCow) -> Result<Self, Self::Error> {
		let me: Self = a.deserialize()?;

		if me.name.is_none() && !me.interactive {
			bail!("either name or interactive must be specified in TabRenameForm");
		}

		Ok(me)
	}
}

impl FromLua for TabRenameForm {
	fn from_lua(_: Value, _: &Lua) -> mlua::Result<Self> { Err("unsupported".into_lua_err()) }
}

impl IntoLua for TabRenameForm {
	fn into_lua(self, _: &Lua) -> mlua::Result<Value> { Err("unsupported".into_lua_err()) }
}

View on GitHub (pinned to 5f901b886b)