Open
Conversation
…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.
This was referenced Mar 13, 2026
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.
This PR fixes various windows path handling bugs. Building on #134 it
/pflag which breaks mkdir on Windows.: [ ] ? /).get_file_pathwasn't usingtypesostate_dir/workspace/name.jsonwould be incorrectly rendered asstate_dir/name.json.It also
C:foo)./mnt/<drive letter>paths.Individual commits are self-describing — see the commit log for details.