microsoft / microsoft/PowerToys

New+ FileNames don't inherit Changed Folder names with $PARENT_FOLDER_NAME

Open
#50,028 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Needs-Triage
Dominant language
C
Stars
139k
Forks
8.6k
PR merge metrics
PR metrics pending

Description

Description of the new feature / enhancement

I was trying to use New+ to make it so I could create python module skeletons quicker. So I setup a New+ template as such

  • PythonModule (folder)
    • init.py (file)
    • $PARENT_FOLDER_NAME.py (file)
      But when I then use this template in New+ I obviously rename the PythonModule folder to whatever I want (e.g. Testing) but the file that has the macro in it, remains named PythonModule.py

Obviously this feels like a bug but maybe it's intended, but it would be very helpful if the macro'd file actually renamed to the new folder (as it seems was more likely to be the intended use)

Scenario when this would be used?

Anytime you use a New+ template and you'd expect the file to have the parent folder name as part of the file.

Supporting information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the New+ template handling for folder renames and the $PARENT_FOLDER_NAME macro. Reproduce the PythonModule-to-Testing example, then verify that the generated file is renamed from PythonModule.py to Testing.py while init.py remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
desktop, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.