Integrate community fixes from 7 unmerged PRs#2
Merged
Conversation
…ager' with periodic_save
Add guard clause to skip panes that have already been processed by another branch in symmetric layouts (e.g., perfect cross layout). This prevents nil pane access errors when a pane appears in both right and bottom branches. Fixes MLFlexer#98
…truction Covers the path handling behaviour added and fixed in the sibling commit: ensure_folder_exists: nested creation, idempotency, spaces in directory names, relative paths, the negative case where a file blocks a path segment, and Windows-specific forms (absolute drive letter, drive-relative C:foo normalisation). UNC paths are explicitly noted as untestable without a live network share or privileged loopback. state_manager get_file_path (exercised via load_state, which passes its return value straight to file_io.load_json): separator between save_state_dir and type, path separator sanitisation in file names, and reserved character sanitisation (: [ ] ? /). Also adds a Testing section to README.md documenting how to install Busted via LuaRocks and run the suite, including Windows-specific notes about using PowerShell and providing a GCC toolchain for native dependencies.
utils.lua — ensure_folder_exists: - Removes the invalid /p flag on Windows mkdir and -p on Unix; the segment-by-segment loop makes both unnecessary. - Fixes a gsub bug where the closing quote was inside the replacement string, corrupting any path containing a forward slash on Windows. - Adds shell_mkdir with proper quoting: single-quote wrapping on Unix (neutralises spaces and most metacharacters), double-quote on Windows with rejection of " (not a valid NTFS filename character). - Adds parse_root to handle all Windows path forms: absolute (C:\foo), drive-relative (C:foo normalised to C:\foo), and UNC (\server\share, supported only when the share already exists). - Adds mkdir_if_missing to encapsulate the existence-check-then-create pattern, leaving ensure_folder_exists as a clean orchestrator. state_manager.lua — get_file_path: - Fixes a missing separator between save_state_dir and type in the format string, which produced paths like state_dir/name.json instead of state_dir/workspace/name.json. - Expands filename sanitisation to cover Windows reserved characters (: [ ] ? /) in addition to the platform path separator.
WezTerm reports WSL pane working directories as /mnt/c/... (the WSL mount path). The Windows mux rejects these when spawning restored panes because they are not valid Windows paths. Convert /mnt/<drive>/<rest> to <DRIVE>:\<rest> at save time so the stored CWD is a Windows path the mux can validate. The existing /C:/... -> C:\... strip is retained for native Windows panes. Pure Linux paths (/home/...) remain unresolvable in a Windows mux context and are left as-is.
…xecute` but `io.open` and `os.remove` on a tmp file as suggested by https://github.com/azinsharaf in MLFlexer#125 (comment) hopefully fixing MLFlexer#125 for all
…s` in `opts` for `dev.wezterm` plugin call `dev.setup(opts)` to work with local copy (and fork) - cf ChrisGVE/dev.wezterm#1
…uctural changes Adds resurrect.state_manager.event_driven_save(opts) as a complement to periodic_save. Instead of a timer, it saves whenever pane/tab structure changes (detected via pane-focus-changed) and optionally on shell-reported events via user-var-changed (e.g. directory changes with OSC 1337 shell integration). Also updates current_state on every save so that resurrect_on_gui_startup always has a fresh workspace to restore. Documents the new function, its opts, the shell integration pattern, and the two new events in the README.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Cherry-picks and integrates fixes from 7 unmerged upstream PRs:
module 'resurrect' not foundandstate_managernil errors (module 'resurrect' not found MLFlexer/resurrect.wezterm#117, attempt to index a nil value (field 'state_manager') MLFlexer/resurrect.wezterm#119)wezterm.run_child_processinstead ofos.executefor mkdir/nix/store/*paths in saved.window_states[*].tabs[*].pane_tree.process.argvfor vim/nvim/gvim MLFlexer/resurrect.wezterm#128 - Sanitize/nix/store/*paths for vim/nvim/gvim (NixOS)Conflict Resolution
PR MLFlexer#130 and MLFlexer#136 both modified
utils.lua. Resolved by keeping MLFlexer#136's comprehensive structure (parse_root, dir_is_accessible, mkdir_if_missing) but replacingshell_mkdir'sos.executewithwezterm.run_child_processto avoid visible cmd.exe window flashes on Windows.Test plan
Generated with Claude Code