Questions tagged [ps1]
The ps1 tag has no usage guidance.
43
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 ...
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 ...
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 ...
9
votes
3
answers
50k
views
Windows task schduler keep showing 0x41301
I have wrote the following .ps1 file:-
[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}
$request = [System.Net.WebRequest]::Create("https://localhost/")
$response = $...
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
6k
views
How can I change my prompt to include box drawing Unicode characters?
How can I get a $PS1 containing box-drawing characters?
I am running bash, if it makes a difference.
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 &...
4
votes
3
answers
868
views
Make Bash's PS1 show original directory name and not symlink?
I currently have PS1='\W' but when in a symbolic link'd directory, the prompt shows the symlink name, how can I make PS1 to show the original directory name?
4
votes
1
answer
2k
views
Why is my bash prompt repeating its last line twice, when I ls, or cd or issue misc commands?
My prompt is such:
PS1="\[\033[32m\]\u@myserver\n\[\033[33m\w$\033[0m\] "
So as output after I ls i see this:
jake@myserver
~/public_html$
~/public_html$
When I should only (I think) see:
jake@...
4
votes
1
answer
2k
views
PS1 window title under PuTTY with GNU screen
I'm currently setting my PS1 title with by concatinating three variables in my .bashrc in such a way:
export TERMSERVER=`who am i | awk '{print $NF}' | tr -d ')''('`
if [ -n "$TERMSERVER" ] ; then
...
3
votes
1
answer
2k
views
Limit git prompt branch name width in oh-my-zsh
I use long descriptive branch names in git, causing the prompt to take up too much space leaving less room for long paths.
I would like to limit the git plugin's branch segment to something like 15 ...
3
votes
1
answer
925
views
bash's command number ( \# ) equivalent in zsh
I'm looking for a character to put in my zsh's $PROMPT that would be equivalent to bash's \# (the command number of this command, according to this site). So far I've found only %h but this is not ...
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 ...
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 ...
2
votes
1
answer
2k
views
Cannot change tab label in MobaXterm
I am using MobaXterm v20.6 and WSL2+Ubuntu 20.04 from Microsoft Store. I am trying to label the tabs defining PS1 like: PS1="\e]0;\u@\h\a\w #" but tabs are still labeled as "1. WSL-...