A string of characters displayed by interactive shells to signal the shell is waiting a user input.

learn more… | top users | synonyms

2
votes
3answers
906 views

How can I get my PS1 prompt to show time, user, host, directories and git branch

I've seen others add all this information to their PS1 prompt. I like the approaches that colorize the elements and also do a carriage return at the end
4
votes
0answers
39 views

Unknown word comes up automatically after changing password on a user

I am using Redhat 5.4 and when I tend to change Oracle user password this comes up right after hitting Enter: passwd oracle Retype new UNIX password: passwd: all authentication tokens updated ...
0
votes
0answers
16 views

Character shows up when scrolling through history with arrow keys [closed]

I am thinking my problem is the same (or very similar to) this question but I don't understand the solution if it applies. The selected answer states to use \[...\] to wrap sections with length 0 in ...
20
votes
3answers
11k views

What color codes can I use in my PS1 prompt?

I used several colors in my PS1 prompt such as \033]01;31\] # pink \033]00m\] # white \033]01;36\] # bold green \033]02;36\] # green \033]01;34\] # blue \033]01;33\] # bold yellow Where can I ...
0
votes
1answer
2k views

Changing title without changing prompt on Cygwin

I have the following shell script function from this site that allows me to change the title in both Putty and Cygwin. In Putty connected to a Linux host it changes the title and leaves the prompt as ...
6
votes
3answers
8k 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" ...
5
votes
1answer
222 views

Keep bash input on top line of screen

I'd like to keep the bash command prompt input at the top of the screen so that outputs from older commands are pushed downwards rather than up. How can I achieve this?
106
votes
15answers
151k views

Colorizing your terminal and shell environment?

I spend most of my time working in Unix environments and using terminal emulators. I try to use color on the command line, because color makes the output more useful and intuitive. What options exist ...
2
votes
3answers
93 views

How to show the host name in Linux commandline prompt

I have several VMs and right now my command-line prompt looks like -bash-3.2$; identical on every VM, because it doesn't contain the host name. I need to always see which VM I'm on using hostname ...
1
vote
1answer
25 views

tcsh display cursor on next line

I have been trying to get hold of this since many days. Essentially what I need in my tcsh is this [machine_name:current_dir]72 % instead of [machine_name:current_dir]72 % so that I can ...
1
vote
3answers
41 views

Bash prompt string appears in same line as curl command output

When I run a curl command, the json response that it returns collides with the bash prompt string: ~$curl localhost:8001/api {"message":"this is a test message"}~$ Notice ~$ at the end of second ...
3
votes
1answer
39 views

Bash doesn't calculate prompt length correctly

I've googled around quite a bit on this problem and found a few related problems, like this one: Terminal prompt not wrapping correctly. My problem is that bash doesn't calculate the length of the ...
2
votes
2answers
41 views

Change PS1 color when connected to other host via SSH

I'm trying to change PS1 look based on what host I'm connected in using SSH. My current PS1: PS1='\[\e[1;32m\]\u@\h\[\e[1;34m\] \w\[\e[1;31m\]$(__git_ps1)\[\e[1;0;37m\] \$\[\e[0m\] ' For host host1 ...
2
votes
3answers
98 views

Show only current and parent directory in bash prompt

I'm new to bash and would like my prompt to show something that in tcsh was trivial, yet after a good google search I still cannot do. I would like my prompt to include only the current and parent ...
0
votes
0answers
43 views

Adding strings in front of the prompt

I am trying to add an additional string in front of the 'login' names that I usually see in my terminal. Currently, this is what I am seeing, where 'zac' is my user alias and 'titem' is my machine ...
0
votes
1answer
20 views

Bash overwrites the first line when using custom PS1 prompt [duplicate]

My question is similar, but different to, this question. I have created a custom PS1 in my .bashrc, as follows: STARTCOLOR='\e[0;36m'; ENDCOLOR="\e[0m" export PS1="\n$STARTCOLOR\u@\h:\! <\t> ...
0
votes
1answer
35 views

PS1 variable inheritance between scripts and programs using bash in AIX

How to ensure that PS1 variable in AIX bash is inherited between cross calling of scripts and programs ? Suppose a program that give to the user a shell instance like the shell command of vi. This is ...
-1
votes
2answers
75 views

bash scripting and PS1 prompt

Im trying to customize the way the PS1 prompt shows in terminal and CLI on Arch Linux, but it's not printing the proper thing it should be doing. First up is I'm trying to colorize parts of the PS1 ...
0
votes
0answers
18 views

Why is Debian's PS1 variable different from the other distros? [duplicate]

I've noticed that Debian's PS1 variable is a little different. For example: root@debian:~# echo $PS1 ${debian_chroot:+($debian_chroot)}\u@\h:\w\$ What is this part: ...
2
votes
1answer
99 views

How can I make Debian 8's terminal show box-drawing characters? [closed]

I just upgraded to Debian 8 with a fresh install and my terminal prompt (prompt adam2 8bit with ZSH) no longer displays some characters correctly: I've checked the terminal encoding (set to Unicode ...
1
vote
1answer
48 views

How to edit shell prompt to show time?

I would like to edit my shell prompt to display time. Am currently using zsh, though I would like the customize the shell prompt to show time. I understand an echo $PS1 will give me the environment ...
0
votes
1answer
49 views

Describe the prompt I see when I first logged into the Linux computer

Can you please describe and explain each part of the command prompt pi@raspberrypi ~ $ This is what I saw when I first logged in to my Linux computer.
3
votes
2answers
78 views

preventing terminal prompt from being overwritten by program output

Suppose I run a command like this in the terminal: ~$ echo 'sleep 2; echo "hello!"' | sh then start typing the next line. After two seconds the words "hello!\n" will be inserted into whatever I'm ...
2
votes
1answer
39 views

Bell and escape character in prompt string

My prompt string is printed using this statement, printf '\033]0;%s@%s:%s\007' user host /home/user Why does it need an escape character (\033) and a bell character (007)? When i ran the same ...
14
votes
2answers
2k views

Display command in xterm titlebar

My Bash Prompt is currently setting the xterm titlebar using the following sequence: PS1='\033]0;\u@\h>\w\007' Is there an easy way to display the current command in the titlebar. For example, ...
0
votes
1answer
52 views

Custom bash prompt - cursor positioning issue [duplicate]

I know there are many related questions, however I couldn't find any other way to get help on this problem: On my CentOS VM I made a custom script for my bash prompt in /etc/profile.d/custom.sh ...
1
vote
3answers
78 views

How to change bash prompt string in current bash session? [duplicate]

I have a following bash prompt string: root@LAB-VM-host:~# echo "$PS1" ${debian_chroot:+($debian_chroot)}\u@\h:\w\$ root@LAB-VM-host:~# hostname LAB-VM-host root@LAB-VM-host:~# Now if I change ...
2
votes
2answers
65 views

Bash input in the same line

My server is a Debian distro. I am currently configuring this bad boy up. In my Bash, I'm used to having the input to the command line being in one line, i.e.: root@my-server:~ $ cd .. ...
5
votes
2answers
91 views

Elegant way to prevent command substitution from removing trailing newline

I'm customizing my zsh PROMPT and calling a function that may or may not echo a string based on the state of an environment variable: function my_info { [[ -n "$ENV_VAR"]] && echo "Some ...
3
votes
1answer
95 views

Bash prompt: using \[ and \] within PROMPT_COMMAND

I'm working on a bash prompt. I'm also trying to create the prompt intelligently, so that it will be easily readable and maintainable. That means not having one huge export PS1. Various sources ...
2
votes
2answers
96 views

Zsh: Expanding hashed directory names in prompt

I am experimenting with moving from bash to zsh, and in particular with the hash function; so that hash -d Do=~/Downloads means I can enter cd Do to move immediately to that directory. Nice. But ...
1
vote
1answer
52 views

Bashrc PS1 error

I created a nice PS1 for bash with http://bashrcgenerator.com/, but something seems to go wrong. The terminal emulator shows me some random, characters which means that PS1 probably has a syntax ...
-1
votes
1answer
117 views

Add git information to a bash prompt with colors

I set my PS1='[\u@\h \W$(__git_ps1 " (%s)")]\$ ' I followed this link, to setup my git. And I lost the color of my prompt. If I remove the variable, the color comes back. I am using Xubuntu, 15.04, ...
3
votes
1answer
3k 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 \$'
0
votes
1answer
48 views

ksh: Not importing prompt settings from /etc/profile

I am using SUSE Linux Enterprise Server 11 SP3 and I am facing an issue related with a user using ksh. I have created a user as follows: ...
1
vote
1answer
52 views

How to wrap bash commands after adding color

My current .bash_profile is equal to the below. I add some color and add a command that outputs whether or not I am in a git repository to my PS1 for my bash profile. ORIG=$PS1 ...
2
votes
1answer
409 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 written to gather this information are too slow. I'd like to make ...
10
votes
3answers
4k views

Terminal prompt not wrapping correctly

I have an issue where if I type in very long commands in bash the terminal will not render what I'm typing correctly. I'd expect that if I had a command like the following: username@someserver ...
-2
votes
2answers
85 views

autocomplete weirdness as a result of ugly hack for zsh prompt

I currently have the following line in my .zshrc: export PROMPT=$(printf "\e[38;5;6m")%m$(printf "\e[m")%d-%h:" " Which is supposed to show the hostname in blue and history and current working ...
3
votes
1answer
62 views

Combine 2 prompts into one, showing error condition in red/orange

Not a very interesting question, but the answer could be beneficial to a lot of users. ;-) As everyone, I have a customized prompt. Mine turns red for root and is green for a normal user and a few ...
1
vote
0answers
35 views

Responding to prompts automatically?

Lets say I have a script called RPS that simulates rock paper scissors. For example lets say I run the script with "$sh RPS". The script will echo "paper" and then prompt me for an input. Obviously ...
6
votes
4answers
832 views

Bash prompt that won't clobber long commands

I'm trying to set up a bash prompt for - hostname(screen#):directory$ which is coloured green if the last command completed successfully, red if not. This is what I have so far, which actually does ...
0
votes
0answers
36 views

How to change the password display in linux? [duplicate]

In general when we enter the password, nothing is display in the screen. I want to display * when I enter password in Linux. Current behavior: abc@123:$ su testuser ...
4
votes
3answers
313 views

Asynchronous RPROMPT?

A friend of mine posted this on StackOverflow, and I thought we might be more likely to get an answer here. His post refers to speed, but we now know that the python script we are using to parse git ...
7
votes
1answer
382 views

In which situations are PS2, PS3, PS4 used as the prompt?

When I log on into the shell I see the prompt whose value is stored in PS1. I also encountereded another prompt (but do not know which one) when I used the here-document syntax: bc << HERE ...
2
votes
2answers
47 views

Is it possible to change the PS1 periodically by a script in the background?

I just came across the PS1 variable (so I am far from being an expert). It is possible to change the prompt by simply changing this variables value, for instance: PS1="\h" hostname as Prompt PS1="\j" ...
5
votes
3answers
379 views

Display Non-Zero Return Status in PS1

I want to include the return status in my prompt. (Easy add '$? ', right?) However, I only want the status returned (and trailing space) if non-zero. Example: sd ~ $ false 1 sd ~ $ true sd ~ $
6
votes
2answers
14k views

executing if-statement from command prompt

In bash I can do the following: if [ -f /tmp/test.txt ]; then echo "true"; fi However, if I add sudo in front, it doesn't work anymore: sudo if [ -f /tmp/test.txt ]; then echo "true"; fi -bash: ...
7
votes
1answer
750 views

Why ZSH ends a line with a highlighted percent symbol?

I've noticed this on occasion with a variety of applications. I've often thought it was because the output was cancelled early (ctrl+c, for example) or something similar, and zsh is filling in a new ...
1
vote
1answer
135 views

bash: The prompt gets visually broken [duplicate]

The idea of my PS1 configuration is to show some extended info like Mercurial or Git repo status, command execution time, etc. The prompt is split by two lines because it produces too many characters ...