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

found no sender to send plugin instruction to

Error message

found no sender to send plugin instruction to

What it means

The filesystem-watch thread (spawned per watch request) needs the plugin-instruction sender to deliver Event::FileSystemUpdate. This non-fatal error logs when senders.to_plugin is None at delivery time — the sender channel was never present or was dropped, most commonly because the session is shutting down while the watcher thread is still running.

Source

Thrown at zellij-server/src/plugins/zellij_exports.rs:3998

                    let send_plugin_instructions = env.senders.to_plugin.clone();
                    let update_target = Some(env.plugin_id);
                    let client_id = env.client_id;
                    thread::spawn({
                        move || {
                            let mut paths_in_folder = vec![];
                            for entry in reading_folder {
                                if let Ok(entry) = entry {
                                    let entry_metadata = entry.metadata().ok().map(|m| m.into());
                                    paths_in_folder.push((
                                        PathBuf::from("/host").join(
                                            entry.path().strip_prefix(&plugin_host_folder).unwrap(),
                                        ),
                                        entry_metadata.into(),
                                    ));
                                }
                            }
                            let _ = send_plugin_instructions
                                .ok_or(anyhow!("found no sender to send plugin instruction to"))
                                .map(|sender| {
                                    let _ = sender.send(PluginInstruction::Update(vec![(
                                        update_target,
                                        Some(client_id),
                                        Event::FileSystemUpdate(paths_in_folder),
                                    )]));
                                })
                                .non_fatal();
                        }
                    });
                },
                Err(e) => {
                    log::error!("Failed to read folder {}: {e}", folder_to_scan.display());
                },
            }
        },
        Err(e) => {
            log::error!(

View on GitHub (pinned to 98a0837077)

Solutions

  1. No action needed for users — it is non-fatal and expected during shutdown races
  2. Unsubscribe/stop watching in the plugin's cleanup path to terminate watcher threads earlier
  3. If developing zellij, consider swapping the ok_or/map chain for a plain if-let so shutdown does not log an error
Defensive patterns

Strategy: fallback

Try / catch

// treat missing sender as shutdown, not error
if let Some(sender) = send_plugin_instructions {
    let _ = sender.send(PluginInstruction::Update(vec![(update_target, Some(client_id), Event::FileSystemUpdate(paths))]));
}

Prevention

When it happens

Trigger: A plugin subscribes to filesystem watching and the session exits (or the plugin is unloaded, dropping the senders) before the watcher thread emits its next update; running in a context where the plugin bus sender was never wired.

Common situations: Quitting zellij while a filesystem-watching plugin is active; plugin pane closed while its watch thread is mid-read; test harnesses that build PluginEnv without a real sender.

Related errors


AI-assisted analysis of zellij-org/zellij@98a0837077 (2026-08-16). Data as JSON: /api/errors/541c10408424fa9b. Report an issue: GitHub.