Add the ability to format the string that displays as the prompt, like in bash shell #8345

Closed
opened 2026-01-31 01:27:02 +00:00 by claunia · 2 comments
Owner

Originally created by @elafnit on GitHub (May 20, 2020).

Description of the new feature/enhancement

Showing the complete directory path as the prompt string often pushes the cursor far to the right, especially when traversing deep directory paths as often the case with github cloned repos.
It would be nice to have the ability to customize the prompt string as is the case with Bash shell or Cmder terminal.
Allowing this capability would also allow the capability to customize the prompt based on the location. Again as with Cmder, one can added the state of the git directory space with color queuing when in a git repo.

Proposed technical implementation details (optional)

Originally created by @elafnit on GitHub (May 20, 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 Showing the complete directory path as the prompt string often pushes the cursor far to the right, especially when traversing deep directory paths as often the case with github cloned repos. It would be nice to have the ability to customize the prompt string as is the case with Bash shell or Cmder terminal. Allowing this capability would also allow the capability to customize the prompt based on the location. Again as with Cmder, one can added the state of the git directory space with color queuing when in a git repo. # Proposed technical implementation details (optional)
claunia added the Issue-QuestionNeeds-TriageNeeds-Tag-FixResolution-Answered labels 2026-01-31 01:27:03 +00:00
Author
Owner

@zadjii-msft commented on GitHub (May 20, 2020):

This is something that's totally at the liberty of your shell. Like you've mentioned, bash lets you customize the prompt with $PS1. cmd configures the prompt with the PROMPT environment variable. powershell also lets you configure the prompt (though I'm less familiar with the how there).

I personally use something like

$e[30;107m[$T]$e[97;46m$P$e[36;49m$e[0m$_$e[0m$e[35;49m[18]$e[m$e[0m$e[94mmigrie$e[0m@$e[32mMIGRIE-SLAPTOP$e[0m$G

to get
image

in cmd

@zadjii-msft commented on GitHub (May 20, 2020): This is something that's totally at the liberty of your shell. Like you've mentioned, `bash` lets you customize the prompt with `$PS1`. `cmd` configures the prompt with the `PROMPT` environment variable. `powershell` also lets you configure the prompt (though I'm less familiar with the how there). I personally use something like ``` $e[30;107m[$T]$e[97;46m$P$e[36;49m$e[0m$_$e[0m$e[35;49m[18]$e[m$e[0m$e[94mmigrie$e[0m@$e[32mMIGRIE-SLAPTOP$e[0m$G ``` to get ![image](https://user-images.githubusercontent.com/18356694/82464074-41968c00-9a83-11ea-90e6-5721fa585420.png) in `cmd`
Author
Owner

@elafnitzegger commented on GitHub (May 20, 2020):

Thanks. I didn't consider making the changes at that level for powershell

@elafnitzegger commented on GitHub (May 20, 2020): Thanks. I didn't consider making the changes at that level for powershell
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#8345