Skip to content

fix Add options "Automatic Directory Creation with Slash" #2640 - #2702

Open
asukaminato0721 wants to merge 2 commits into
sinelaw:masterfrom
asukaminato0721:2640
Open

fix Add options "Automatic Directory Creation with Slash" #2640#2702
asukaminato0721 wants to merge 2 commits into
sinelaw:masterfrom
asukaminato0721:2640

Conversation

@asukaminato0721

Copy link
Copy Markdown
Contributor

fix #2640

New files can use nested paths such as src/components/app.rs; missing directories are created automatically.
Relative . and .. components remain supported.
Absolute, drive-prefixed, and UNC paths are rejected.
~ and $HOME remain literal—no expansion.
Filesystem and permission errors are handled without panics.
Added localized validation messages and regression coverage.

@sinelaw sinelaw added the in-review label Jul 16, 2026 — with Claude

@sinelaw sinelaw left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an autogenerated comment

  • Confirms bug: master's perform_file_explorer_rename rejects any / in new-file names, matching issue #2640.
  • Fix reuses the existing FileSystem::create_dir_all trait method (no raw std::fs), keeps the pre-existing rename/validation flow, and adds the check only for is_new_file — minimal, non-duplicative, no architectural changes.
  • All 14 locale files got the new explorer.new_item_path_must_be_relative key; unit + e2e tests added (fail-without-fix pattern).
  • Interactively verified in tmux against a debug build on the PR branch:
    • Ctrl+N → typed src/components/app.rs → dirs auto-created, temp untitled_* file moved into place, buffer focused on the new file.
    • Typed an absolute path (/etc/passwd_evil) → rejected with "New item path must be relative", nothing created outside the project.
    • Typed ../outside_project/evil.txt → allowed and escaped the project dir, matching the issue's explicit spec that ./.. remain literal relative components (not a regression).
  • No duplicate/adjacent existing feature found.

Generated by Claude Code

@sinelaw sinelaw added reviewed and removed in-review labels Jul 16, 2026 — with Claude
@sinelaw

sinelaw commented Jul 16, 2026

Copy link
Copy Markdown
Owner

Escaping the project dir shouldn't be allowed, e.g. we can evaluate the absolute canonical target path and check that its under the project dir

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add options "Automatic Directory Creation with Slash"

2 participants