Questions tagged [ps1]
The ps1 tag has no usage guidance.
7
questions
40
votes
2
answers
12k
views
Linux: coloring bash prompt will break carriage return
When I try to colorize the bash prompt like this:
export PS1="\e[0;31m[\u@\h \W]\$ \e[m "
it breaks the carriage return (instead of going to a new line when line is full, it starts in the same line ...
1
vote
1
answer
376
views
PS1 problem, cmd is looping [duplicate]
I've set PS1 to the following value:
PS1="\033[0;37m[\033[1;33m\w\033[0;37m]\n\t \[[34m\]\u\033[0;37m@\[[34m\]\[[1m\]\h\[(B[m\] $"
The problem is that any command spanning more than a line loops ...
28
votes
9
answers
35k
views
Right align part of prompt
I am sure that I have seen someone have a part of their prompt aligned to the right in their terminal window and then have the actual cursor start on a second line. I know that I can achieve the ...
8
votes
2
answers
14k
views
Powershell Get-ChildItem Include\Exclude - simple script not working properly
Im trying to run the following code as a powershell script,but I cant get it to work. 1st,the following works with one -Include item but I cant seem to get it to work with multiple ones. 2nd, the -...
5
votes
2
answers
2k
views
Is there a command to get bash to print a new prompt string and redraw the current line?
Instead of waiting for slow commands to finish, I'd like to run them in the background. However, when they finish running and print to stdout, I get (where █ represents my cursor) this:
$ slowcmd &...
1
vote
3
answers
365
views
Is it possible to have environment variables in the path of the working directory : PS1?
I am on Lubuntu and I am using bash. My PS1 (in .bashrc) is :
PS1="\w> "
I like it because I need to paste the working directory all the time.
The problem is that the path is always very long and ...
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 ...