{"record":{"id":"581034239cf080f4","repo":"sxyazi/yazi","slug":"either-name-or-interactive-must-be-specified-in-ta","errorCode":null,"errorMessage":"either name or interactive must be specified in TabRenameForm","messagePattern":"either name or interactive must be specified in TabRenameForm","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"yazi-parser/src/mgr/tab_rename.rs","lineNumber":22,"sourceCode":"use yazi_shared::event::ActionCow;\nuse yazi_shim::SStr;\n\n#[derive(Debug, Deserialize)]\npub struct TabRenameForm {\n\t#[serde(alias = \"0\")]\n\tpub name:        Option<SStr>,\n\t#[serde(default)]\n\tpub interactive: bool,\n}\n\nimpl TryFrom<ActionCow> for TabRenameForm {\n\ttype Error = anyhow::Error;\n\n\tfn try_from(a: ActionCow) -> Result<Self, Self::Error> {\n\t\tlet me: Self = a.deserialize()?;\n\n\t\tif me.name.is_none() && !me.interactive {\n\t\t\tbail!(\"either name or interactive must be specified in TabRenameForm\");\n\t\t}\n\n\t\tOk(me)\n\t}\n}\n\nimpl FromLua for TabRenameForm {\n\tfn from_lua(_: Value, _: &Lua) -> mlua::Result<Self> { Err(\"unsupported\".into_lua_err()) }\n}\n\nimpl IntoLua for TabRenameForm {\n\tfn into_lua(self, _: &Lua) -> mlua::Result<Value> { Err(\"unsupported\".into_lua_err()) }\n}\n","sourceCodeStart":4,"sourceCodeEnd":36,"githubUrl":"https://github.com/sxyazi/yazi/blob/5f901b886b14de1f17460b6e52e9de5d67f8aba9/yazi-parser/src/mgr/tab_rename.rs#L4-L36","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Pass a `name` string, e.g. `tab_rename({ name = 'build' })`","Or set `interactive = true` to open an interactive rename prompt: `tab_rename({ interactive = true })`","Check for field-name typos in the payload table"],"exampleFix":"// before\nManager:tab_rename({})\n// after\nManager:tab_rename({ interactive = true })","handlingStrategy":"validation","validationCode":"local opts = opts or {}\nassert(opts.name or opts.interactive, \"tab_rename requires 'name' or interactive = true\")\nManager:tab_rename(opts)","typeGuard":"local function is_valid_rename_opts(opts)\n  return type(opts) == \"table\" and (type(opts.name) == \"string\" or opts.interactive == true)\nend","tryCatchPattern":null,"preventionTips":["Always pass either `name` or `interactive = true` to tab_rename","Check field-name spelling against the TabRenameForm schema","Validate user-supplied option tables before emitting actions"],"tags":["plugin-api","validation","lua","action-payload"],"backgroundTag":"missing-required-action-field","analyzedSha":"5f901b886b14de1f17460b6e52e9de5d67f8aba9","analyzedAt":"2026-09-02T18:38:25.566Z","contentChangedAt":"2026-09-02T18:38:25.566Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}