Customizable/Shortened cwd path in prompt for windows shells #6577

Closed
opened 2026-01-31 00:42:06 +00:00 by claunia · 1 comment
Owner

Originally created by @cbrit on GitHub (Feb 21, 2020).

Description of the new feature/enhancement

I expect this is either implemented or requested already, but I can't find it so here goes.

Basically it would be nice to alter the appearance of the current working directory in my prompt to be shorter. For example ~\src>, or even just src> (current folder only) instead of C:\Users\Name\src>. I am usually working in a project directory that is 5-6 directories deep which means the prompt takes up half of my pane if I'm doing split screen.

I am aware that the original cmd.exe has some options for changing the prompt but it is no where near as flexible as bash-style prompt alterations.

Proposed technical implementation details (optional)

I don't know the technical requirements for this kind of change for Windows but I wanted to at least suggest it.

Apologies if this is already something that has been posted about.

Originally created by @cbrit on GitHub (Feb 21, 2020). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> # Description of the new feature/enhancement I expect this is either implemented or requested already, but I can't find it so here goes. Basically it would be nice to alter the appearance of the current working directory in my prompt to be shorter. For example `~\src>`, or even just `src>` (current folder only) instead of `C:\Users\Name\src>`. I am usually working in a project directory that is 5-6 directories deep which means the prompt takes up half of my pane if I'm doing split screen. I am aware that the original cmd.exe has some options for changing the prompt but it is no where near as flexible as bash-style prompt alterations. <!-- A clear and concise description of what the problem is that the new feature would solve. Describe why and how a user would use this new functionality (if applicable). --> # Proposed technical implementation details (optional) I don't know the technical requirements for this kind of change for Windows but I wanted to at least suggest it. <!-- A clear and concise description of what you want to happen. --> Apologies if this is already something that has been posted about.
claunia added the Issue-QuestionNeeds-Tag-FixResolution-Answered labels 2026-01-31 00:42:06 +00:00
Author
Owner

@DHowett-MSFT commented on GitHub (Feb 21, 2020):

So! First- we're not going to change CMD, so I'm sorry about that.

Second, however: PowerShell can absolutely do this, and I highly recommend looking into it. You can customize your prompt by overriding the Prompt function, and you can make it do whatever you want.

Since this is more of a question, I'm gonna close it as answered.
Sorry about that!

@DHowett-MSFT commented on GitHub (Feb 21, 2020): So! First- we're not going to change CMD, so I'm sorry about that. Second, however: PowerShell can absolutely do this, and I highly recommend looking into it. You can customize your prompt by overriding the `Prompt` function, and you can make it do whatever you want. Since this is more of a question, I'm gonna close it as answered. Sorry about that!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#6577