Skip to content

Fix/module resurrect not found#123

Open
userux wants to merge 2 commits into
MLFlexer:mainfrom
userux:fix/module-resurrect-not-found
Open

Fix/module resurrect not found#123
userux wants to merge 2 commits into
MLFlexer:mainfrom
userux:fix/module-resurrect-not-found

Conversation

@userux
Copy link
Copy Markdown

@userux userux commented Oct 1, 2025

local resurrect = require("resurrect") in plugin/resurrect/state_manager.lua not importing correct module.
I changed it to local state_manager_mod = require("resurrect.state_manager").

should fix #117 and #119

micimize added a commit to micimize/resurrect.wezterm that referenced this pull request Mar 5, 2026
Addresses a crash loop caused by periodic auto-save capturing ghost SSH
domain tabs (stuck in "Connecting..." with empty cwd and zero dimensions)
into workspace JSON. On restore, these spawn broken tabs that cascade
into UI crashes.

Save-side safeguards:
- Add is_pane_healthy() to filter panes with nil/empty cwd, zero cell
  dimensions, or non-spawnable domains before tree construction
- Skip tabs with no healthy panes in window state serialization
- Skip windows with no valid tabs in workspace save
- Skip periodic save entirely when workspace is degraded
- Create .bak backup before overwriting state files

Restore-side safeguards:
- Add validate_pane_tree() to check cwd and domain validity, with
  recursive pruning of invalid subtrees
- Validate each tab before restoring, skip invalid ones
- Track restored_count independently from loop index for correct
  first-tab reuse logic
- Wrap per-window restore in pcall with state reset on failure
- Guard against empty tabs[1] access when spawning windows
- Fall back to .bak file when primary state file is invalid
- Nil guard on active_tab:activate() (latent upstream bug)

Upstream fixes incorporated:
- PR MLFlexer#127: nil pane guard in insert_panes() for symmetric layouts
- PR MLFlexer#123: use direct require("resurrect.state_manager") to fix
  circular module dependency in save actions
- PR MLFlexer#118: set active workspace after restore_workspace()

Wrap io.lines() in pcall in load_json() to handle missing files
gracefully instead of throwing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

module 'resurrect' not found

1 participant