简体   繁体   中英

Fix the command prompt when using boot2docker

I'm using boot2docker on OS X. If I open up a "normal" terminal, I get the following command prompt:

<machinename>:<currentfolder> <user>$

Eg, when logged in, in my home folder, on my notebook it is:

Schneehase:~ golo$

When starting a terminal using boot2docker, I just get

bash-3.2$

no matter where I am. How can I fix this (and how can I make this permanent)? I am using OS X Yosemite.

The prompt is controlled by the PS1 environment variable.

Your OS X shell and the boot2docker shell have different values for this variable.

Run echo "$PS1" in both shells and then set the boot2docker one to match the one you like.

See the bash man page "Prompting" section for more about what you can do with $PS1 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM