user541686
user541686

Reputation: 210437

Set Win-Bash Prompt to Current Directory?

How can I make the Win-Bash prompt always print the current folder?

I want it to display something like:

MyPC /Data/MyFiles # _

(assuming I'm in the folder /Data/MyFiles) whereas right now, it always displays

bash$ _

no matter what folder I'm in.

Upvotes: 1

Views: 1051

Answers (1)

Dennis Williamson
Dennis Williamson

Reputation: 360035

You should be able to set your prompt like this:

PS1="\w\$ "

and put that in your ~/.bashrc file.

Win-Bash apparently uses a very old version of Bash, so it's going to be somewhat limited.

Upvotes: 2

Related Questions