A string of characters displayed by interactive shells to signal the shell is waiting a user input. The prompt can be used to display variables and data about the enviornment.
3
votes
1answer
199 views
What are special prompt symbols for busybox's sh support?
I want to setup a time prompt on PS1.
But, there is no document about what are symbols the busybox support.
Is there any one know? Here are all which I knew.
PS1='\u@\h: \w \$'
3
votes
2answers
78 views
Highlight path separators in PS1
I want to do something like this in Bash:
how to format the path in a zsh prompt?
But everything I try results in the PWD being fixed to the first directory I start my terminal in. Strangely I've ...
3
votes
1answer
144 views
How to set up `screen` to modify the window title and xterm-window title?
I'd like to have my current $PS1 prompt (\u@\h:\w$(__git_ps1 "(%s)")\$ plus some coloring) to be also used as screen's window title (in the hardline) and as the xterm window title. How can this be ...
2
votes
3answers
311 views
How to make bash put prompt on a new line after cat command?
What I get:
host:~ user$ cat example.txt
some texthost:~ stas$
What I want to get:
host:~ user$ cat example.txt
some text
host:~ stas$
Is there a way I can make cat behave like this?
I'm using ...
2
votes
2answers
281 views
How to change the prompt in Linux?
The default prompt will be
root@monu dev]#
Can we change the "root@monu" part and give it a desired name?
2
votes
2answers
470 views
Bash prompt keeps disappearing
I have a weird issue where my Bash prompt often completely disappears on a backspace. Doesn't make any sense to me, but it happens often:
I can't really think of why this is happening. Am I ...
2
votes
1answer
520 views
How do I customize the bash prompt on centos?
I've altered the /etc/bashrc file.
I commented out the previous definition and inserted my own:
PS1="--bash: (\u@\h:\w) $"
This is not having any affect. When I make this change at the command ...
2
votes
3answers
787 views
How to customize .bashrc to configure command prompt?
Is there an easy way to change my Bash prompt to modify the colors and what text is displayed? I've heard that this is done in .bashrc, but I haven't found any nice, easy ways of modifying it. How are ...
2
votes
1answer
158 views
ZSH %m prompt escape not working as documented under Debian Linux
The zshmisc man page on my new Debian Squeeze install states, under SIMPLE PROMPT ESCAPES:
%m
The hostname up to the first `.'. An integer may follow the '%' to specify how
many components of the ...
2
votes
1answer
540 views
In Bash, why is PROMPT_COMMAND set to something invisible?
On RHEL6 and CentOS 6, /etc/bashrc sets PROMPT_COMMAND here:
case $TERM in
xterm*)
if [ -e /etc/sysconfig/bash-prompt-xterm ]; then
PROMPT_COMMAND=/etc/sysconfig/bash-prompt-xterm
...
2
votes
2answers
832 views
Colored Prompt in KornShell
According to this StackOverflow post, it is possible have a colored prompt in KornShell. I have not been able to figure out how to do this. I am able to use color:
echo -e "\033[34mLinux\033[00m"
...
2
votes
1answer
167 views
Prompting for input in post-install script in dpkg
I am writing a debian package and need to prompt the user for some textual details(default password, etc), as well as some one-of-many choices("Pick one of the following: foo, bar"). Will shell ...
2
votes
1answer
943 views
Showing GNU screen session name and window title in shell prompt
Is there a way to present the GNU Screen session name and window title in the prompt of the shell (let us say, the Bash prompt defined by PS1)?
2
votes
2answers
242 views
Prompt “-bash-3.2$” vs. “bash-3.2$” in SunOS 5.10
When I log into a server running SunOS 5.10, my prompt initially is "-bash-3.2$"
Then when I run the following commands, I can see that the prompt is slightly different after typing bash (it no ...
2
votes
2answers
424 views
Change Korn prompt to show shorter path for working directory
I have changed my .kshrc to show my prompt as follows:
511 /export/home/students/cninja $ where 511 is the command number and ../students/cninja is the current working directory.
Is it possible to ...
2
votes
1answer
100 views
How to put “glue” CWD (etc.) to part of the screen instead of putting into PS1?
I suspect there’s some terminology for this question that I’m not aware of. It’s hard to check if a question has already been answered if one doesn’t know the proper vocabulary. So, sorry if this is ...
2
votes
1answer
687 views
Multiline PS1 prompt
Is the a way to specify a multi line prompt in Korn shell?
I am planning to swhitch from bash to ksh. In bash I have a very simplistic prompt, but it is 2 line prompt. I hate when input position ...
2
votes
1answer
213 views
There is no bash indicator prompt after a forked process terminates
I am reading the book Advanced Programming in the Unix Environment.
There is a test program to test the fork function. It works well in my Ubuntu. But what I confused is that why there is no command ...
2
votes
5answers
2k views
In bash how can I change the color of my command prompt? [duplicate]
Possible Duplicate:
How to customize .bashrc to configure command prompt?
When I run a command, I often times have trouble finding the beginning of the command output. An easy fix to this ...
2
votes
2answers
899 views
Is there a way to push shell config information when SSHing to a host?
I know how to set the GNOME-terminals (or xterms!) prompt to green/red regarding the last exit code:
vi .bashrc
export PROMPT_COMMAND='PS1="`
if [[ \$? = "0" ]];
then echo "\\[\\033[0;32m\\]";
else ...
2
votes
1answer
104 views
Why does newgrp change my PS1 and how to prevent it?
I have a customized PS1 to show several parameters. When I switch to a different group using newgrp, it switched my PS1 to default ($) and that is annoying. The default remains even when I switch ...
2
votes
2answers
209 views
Shell Prompt Customization?
I have used oh_my_zsh (and tinkered with bash_it) on multiple systems and have generally been happy with it, though I hate it's auto-correction feature and generally turn it off.
My usual shell is ...
2
votes
1answer
508 views
Set variables in ZSH precmd and reference them in the prompt
Is there a way to set variables in the precmd function of zsh and then echo them in the prompt?
Something like
function precmd {
GREETING='Hi Kevin!';
}
PROMPT="$GREETING";
2
votes
1answer
68 views
bash prompt with abbreviated current director including dot files?
I have the following in my .bash_profile (from a similar question here:
PROMPT_COMMAND='pwd2=$(sed "s:\([^/]\)[^/]*/:\1/:g" <<<$PWD)'
PS1='\u@\h:$pwd2\$ '
However, if the current directory ...
2
votes
1answer
267 views
vi mode doesn't display correctly on new term
This is a continuation of my previous questions. I currently have the following in ~/.zsh.d/functions.sh
function zle-line-init zle-keymap-select {
psvar[1]="${${KEYMAP/vicmd/}/(main|viins)/-- ...
2
votes
1answer
157 views
Coloring shell command and output differrently [duplicate]
Possible Duplicate:
Customizing bash shell: Bold/color the command
bash $ cat what-i-want
"I want the output be in a different color."
I'd like my commands stand out among the output, ...
2
votes
0answers
218 views
Problems changing PS1 to use special character
I'm trying to get my zsh to look something like this: https://bbs.archlinux.org/viewtopic.php?pid=1068202#p1068202.
Whenever I print the └───╼ part of the PS1 to my terminal (or in the .zshrc for ...
2
votes
0answers
137 views
assigning a multiline variable (tcsh prompt) to another
For tcsh, I have a prompt that is multiline:
set prompt = "%/\\
%n@%m[%h]% "
This shows the cwd on one line and then the user/host on second line. However, with this, I cannot make a copy of that:
...
2
votes
0answers
135 views
What is and how to use PS1 \#
I put this is .bashrc
# colors
NC="$(tput sgr0)"
RED="$(tput setaf 1)"
GREEN="$(tput setaf 2)"
# etc ...
PS1="\[$BROWN\]\u \[$CYAN\]#\# \[$PINK_BLD\]!\!\[$NC\] \[$BLUE\]\W: \[$NC\]"
So
deepo #50 ...
2
votes
0answers
212 views
Populate PS1 asynchronously
I have a few git svn related functions that see if I have to pull/push from/to the repository.
My problem is that the functions I've wrote to gather these informations are too slow, I'd like to make ...
1
vote
3answers
209 views
New bash prompt causing issues
I changed my bash prompt to this:
PS1="\[\033[1;31m[\[\033[1;33m\$(date +%H:%M)\[\033[1;31m] \u:\[\033[1;32m\W\[\033[1;37m\$\[\033[0m\] "
Sorry for the long line, it is mostly due to colors. ...
1
vote
1answer
218 views
Is it possible to customise the prompt to show the if there are any background jobs?
Is it possible to customise the bash prompt to show the if there are any background jobs? I find it easy to forget that there are background jobs.
Say if the prompt was...
$
Is there a way to ...
1
vote
2answers
288 views
Unix read -p command causes bash error, how do I fix it?
I'm trying to prompt the user for a comment
function comment {
if [ ! $1 ]
then
read -p "enter checkin comment < " COMMENT;
else
export COMMENT="$1"
fi
if [ ! $COMMENT ]
...
1
vote
1answer
105 views
zsh prompt not escaped properly
This is my current prompt definition:
PROMPT='%(?..%F{red}%?%f:)%F{blue}%n%f:%F{green}%{${PWD/#$HOME/~}%} %(!.%F{red}.%f)%# %f'
The cursor sometimes starts one character behind the actual prompt, ...
1
vote
1answer
197 views
When a command is over half the terminal size it breaks
Whenever I type in a bash command longer than about half the width of the shell window I'm in, the command breaks like it would if I filled the whole screen
3rd command in image - typed a few xs ...
1
vote
1answer
93 views
Printing evaluated prompt placeholders to screen
Is there a way to print interpreted PS1 variable placeholders to console? Something like
$ echo `%u`
for printing a username or
$ echo `%h`
for printing a host. I do know about environment ...
1
vote
1answer
40 views
Displaying ~ for $HOME in zsh prompt
I have my prompt set to the following:
PROMPT=%F{reset}[%F{blue}%2/%F{reset}]
which displays two parent directories as
[foo/bar]
However, when I'm in $HOME or one directory deep in $HOME, I'd ...
1
vote
2answers
285 views
How to get green/red terminals under OpenBSD?
For linux machines I can use:
# vi ~/.bashrc # red/green terminal colors regarding exit code
export PROMPT_COMMAND='PS1="`
if [[ \$? = "0" ]];
then echo "\\[\\033[0;32m\\]";
else echo ...
1
vote
1answer
67 views
bash prompt - long command circle back to same line after adding color
Note: I am using Putty and my TERM is set to XTERM.
I have added the color to my bash prompt as
PS1="\[\033[0;32m\]\d \t \u\e[1;33m@\H /\W $ \[\033[1;37m\]"
just to simplify PS1 in English -
...
1
vote
1answer
423 views
busybox ash PS1 not expanding
I am trying to setup busybox's ash on an embedded system to support expanding the PS1 prompt statement. I have it currently set as
PS1='\u@\h:\w\$ '
However, all that is displayed is literally ...
1
vote
2answers
235 views
Why sudo timestamp is not updated when NOPASSWD is set?
I've set up sudo not to prompt for password by editing the sudoers file:
myuser ALL=(ALL:ALL) NOPASSWD: ALL
And it works fine, running sudo with no password prompting. But when entering sudo -v I ...
1
vote
2answers
156 views
How to set the command(s) that get run before every single prompt?
I used to know this but I forgot: I want to execute a command or a couple of commands before every single prompt. When I am in our PROD box, I want a big fat reminder above every prompt that says * ...
1
vote
1answer
92 views
zsh delete part of the prompt
When I use reverse history search, then it "eats" a part of my prompt. Sometimes when I type a long command which spans to multi lines, my prompt is also lost.
Have anyone experience this situation? ...
1
vote
2answers
165 views
Is there any way to test out PS1 Bash Prompts before committing them?
I'd like to mess with my Bash prompt, but I'd like to do so in a way that doesn't corrupt my already extant one. I could just comment it out, but is there a way to test it either with an online tool ...
1
vote
1answer
107 views
why does it take long for the bash prompt to return on high system load [closed]
When my server experiences high load and I run a command, there is a long delay after the command has finished before I get the prompt again. Any idea what is causing this?
1
vote
1answer
260 views
Colors not rendered correctly in oh-my-zsh themes
I'm trying to use colors in oh-my-zsh themes. It works fine on my home computer (ubuntu), but in a work computer (Scientific Linux i.e. Enterprise linux) the prompt colors are actually spelled out. ...
1
vote
3answers
152 views
Reevaluate the prompt expression each time a prompt is displayed in zsh
I'm adjusting my zsh prompt, based upon the dallas theme and the dstufft theme from oh-my-zsh. I love how dallas has various sections of the prompt contained in variables, which makes it much easier ...
1
vote
2answers
212 views
Bash prompt when my home directory is a symbolic link
I symlinked my /host/Users/Kevin folder to /home/Kevin. I also edit the /etc/passwd file to /home/Kevin. I logged out and logged back in, however when I open up a terminal it's a bash prompt like so:
...
1
vote
2answers
160 views
Is it possible to know when you're at the first bash prompt of a terminal?
This is sort of a contiunation of my last question: printing saving the last bash input command
Now I want to know if it's possible to know when you're at the first bash prompt of a terminal. So I'm ...
1
vote
0answers
34 views
change prompt formatting based on cwd
I use tcsh. I'd like to have my prompt formatting (coloring/highlighting) change based on what directory I'm in.
Namely, if I'm in one of "my" directories (my username in the full directory path is a ...

