Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

Tagged with
2 votes
2 answers
3k views

How to insert bash scripts inside the PS1 variable

I made a custom PS1 variable, which is a tremendously confusing. Here is the one that is closest to being fully working: PS1="\n[\e[1;31m]\u@\H[\e[35m] \@ [\e[32m] PWD: \w [\e[1;34m]This folder has ...
SOMN's user avatar
  • 1,121
1 vote
3 answers
1k views

Colored PS1 string

Clarification: I want __foo to be executed each time the PS1 string is presented in the terminal, not when the PS1 string is constructed (hence its being in quotes). __foo contains logic that examines ...
Will Vousden's user avatar
2 votes
1 answer
880 views

What prompt is sh using when you type sh into Terminal?

When using the default PS1 prompt that MAC OS/Terminal comes with, when you type sh you get a new style prompt. station-4:~ user$ sh sh-3.2$ When you export your own PS1, this functionality goes ...
Igorio's user avatar
  • 748
9 votes
5 answers
6k views

Set $PS1 differently on local computer and in ssh session

I keep my home directory under version control, so that my basic configuration is easily available on any computer. My bash command prompt on my local computer is a complicated, colorful thing that ...
Will McCutchen's user avatar