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.

learn more… | top users | synonyms

11
votes
5answers
288 views

Stateful bash function

I’d like to implement a function in Bash which increases (and returns) a count with every call. Unfortunately this seems non-trivial since I’m invoking the function inside a subshell and it ...
4
votes
3answers
185 views

What are the color codes that I can 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 ...
2
votes
2answers
40 views

How can I select a beginning…ending portion of a '/' delimited string (PS1 prompt in my case)

I am customizing my PS1 prompt, specifically the $PWD part which is delimited by /'s among several things I like having the current directory. However if the directory is too long I'd like to have ...
1
vote
1answer
28 views

Show path from project root in ZSH Prompt

If my pwd is ~/repos/blog/app/views/, I'd like to show only blog/app/views in the prompt i.e. I want to show only the project root. Project root is the parent directory of .git directory. Is there a ...
1
vote
1answer
24 views

Expansion in zsh prompt

I'm struggling with zsh prompt, trying to convert my bash prompt to zsh hooks. This code should display the current kerberos ticket and update accordingly, but colors don't work, neither does the ...
3
votes
4answers
84 views

How do I output a suggestion for a user to accept and use as input?

What can I do to leave the cursor on the same line of the suggestion in a Bash script? Bash version = 3.2.51 It's purpose is to suggest a string so that the user should only press Enter. #!/bin/sh ...
0
votes
2answers
64 views

How can I shorten my customized PS1 prompt?

I currently have my prompt as durrantm@Castle2012-Ubuntu-laptop01:~/Dropnot/webs/rails_apps/linker (master) $ which I really like as it shows my username, machine, directory and git branch! How ...
1
vote
1answer
42 views

Bash: show prompts if arguments weren't provided

What is the best way of supporting in the script prompts and arguments at the same time? I want to show prompts if arguments weren't provided. Is there something better/shorter than this? ⇩ ...
1
vote
1answer
77 views

Changing text color in c-shell

I can change the text color in the terminal permanently by adding this: export PS1="\e[0;31m[\u@\h \W]\$ \e[m" to the .bashrc file. Now I have to go into cshell, what is the corresponding way?
-2
votes
1answer
44 views

How to modify the shell prompt? [duplicate]

I would like to learn how to make my shell look like this: [user@host ~/Folder] $ instead of (the default): [user@host ~/Folder]$. Also, I'd like to have color on user@host and Folder. How can ...
1
vote
1answer
32 views

Problem with command promp cycling when using colors and trying to put git branches on the command prompt

tl;dr: I want my command prompt to be customizable with any color I want and also display the current git branch that I am on. I am aware that there are at least six different post asking an ...
10
votes
1answer
336 views

Clear old prompt lines in bash to save scroll space

My terminal theme used to be like this, But I thought the prompt wasted so much space. And later I got an idea that I could clean the prompt every time I ran a command. I was using bash, one of ...
5
votes
2answers
134 views

issue with terminal/prompt

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 ...
6
votes
3answers
170 views

How to include commands in Bash's PS1 without breaking line length calculation?

Tonin pointed out a bug in my default prompt. Minimal example: Set PS1: PS1='$(exit_code=$?; [[ $exit_code -eq 0 ]] || printf %s $(tput setaf 1) $exit_code $(tput sgr0) " ")$ ' At this point, the ...
0
votes
1answer
107 views

Changing hostname doesn't change the terminal name

I had set my hostname while installing linux as "ankit". i want to change it to "ankit.centos". I tried changing hostname in /etc/hosts, /etc/sysconfig/network and sysctl kernel.hostname=ankit.centos. ...
-1
votes
2answers
199 views

Make my own basic shell [closed]

I know there are a hundred ways of doing this, but I'm just asking what is the most common way: How do I make my own terminal prompt? In other words, I want something like the shell where I type a ...
1
vote
1answer
137 views

How can I change my bash prompt to show my working directory?

I can print my current working dir like this myPrompt$ pwd /Users/me/myDir I want my shell to look like this /Users/me/myDir$ pwd /Users/me/myDir Is that possible? How can I do it?
1
vote
0answers
26 views

Properly defining a multi-line prompt in tcsh

I am trying to configure my prompt in tcsh to make it multi-line (i.e having one line provide system info, and the next line the one where I type commands). Currently I have the following: set ...
0
votes
1answer
31 views

Unexpected output after switch to root

Does somebody know, why I get -ne (probably param from echo from section of setting PROMPT_COMMAND line 23) after I switch to root? Here is my /etc/bashrc. Bash 3.2.51, OS X 10.9 ...
2
votes
2answers
264 views

bash PS1 256 colors with bold

I want to list all colors that I can use in bash console. And after it I want to set my prompt to be bold and orange like color. I'm using this to do listing color codes for me: for code in {0..255}; ...
0
votes
2answers
132 views

debian prompt is broken

When I login via ssh or from the console this is what I see: Linux sensu.lbox.com 3.2.0-4-amd64 #1 SMP Debian 3.2.46-1+deb7u1 x86_64 The programs included with the Debian GNU/Linux system are free ...
3
votes
0answers
87 views

“Overlay” a shell prompt on top of a terminal session? [closed]

I have several CLI application ideas that would be nice to run as an "overlay" on top of my terminal session. In other words I would like to superimpose a box containing a real live shell prompt on ...
2
votes
2answers
281 views

How do I make the Xterm window title switch between the current running command and the current path?

I want to set the Xterm window title to switch between two states: When a command is running, show the command name (e.g. "less") When no command is running, show the current path (e.g. "src") I ...
0
votes
0answers
101 views

Mac OS X: Terminal Prompt Username

I'm using Mac OS Snow Leopard (v10.6.8). I've changed the account name under System Preferences > System > Accounts > Full Name. However, that does not change the username on the terminal ...
1
vote
0answers
16 views

Using tput in $PS1 is breaking line wrapping [duplicate]

Good Morning- I'm trying to use tput outputs in my $PS1 to set the background color to red in the event I'm on a production server: if [[ `hostname -s` = prod-db ]]; then export ...
3
votes
2answers
86 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 ...
2
votes
1answer
96 views

My bash prompt is not working in `screen`

On RedHat, screen resets my bash prompt. I set PS1=\u@\h:\w in ~/.bashrc and ~/.bash_profile. I added shell -$SHELL as well to ~/.screenrc. But, when I open a brand new terminal window, the prompt ...
1
vote
1answer
85 views

Mysterious repeating of entered command in shell

After booting up my system and logging in (before starting X, I start it manually via startx) I suddenly get the following output after entering a command: $ cmd ;user@host: cmd;cmd;cmd; [output of ...
2
votes
1answer
103 views

Android bash prompt corrupt with long pwd

I'm using bash inside Jack Palevich's Android Terminal Emulator, run on an Android phone. The bash version is 4.2.20(1)-release, obtained from samveen on the XDA forum. My prompt is: export ...
4
votes
2answers
93 views

Emacs shell mode makes $PS1 different

I have a custom $PS1 variable that looks like this on my command line: And on emacs using M-x shell unfortunately looks like this: Here is my $PS1 variable export PS1='\[\e]0;\u@\h: ...
1
vote
2answers
171 views

Adding to PS1 in bash_profile

In my .bash_profile currently, I have PS1='\[\e[1;91m\][\u@\h \w]\$\[\e[0m\] '. I am trying to follow these commands to show branch name on iTerm terminal. I changed my PS1='\[\e[1;91m\][\u@\h ...
0
votes
2answers
130 views

scp from remote host fails due to login greeting set in .bashrc [duplicate]

My simple file scp from a remote host (actually a locally run VM but that shouldn't matter) failed without displaying any error message but clearly not having copied the desired file: scp ...
3
votes
2answers
110 views

How change prompt of subshell

I'm trying to create a simple script that, among other things, will create a subshell: #!/bin/sh # setup "${@:-$SHELL}" # teardown The question is: I need to change the default prompt, so for ...
2
votes
2answers
252 views

$PS1 on Ubuntu VM does not match actual prompt

I am running an Ubuntu VM out of Virtual Box and Vagrant: vagrant@lucid64:~$ uname -a Linux lucid64 2.6.32-38-server #83-Ubuntu SMP Wed Jan 4 11:26:59 UTC 2012 x86_64 GNU/Linux My $PS1 variable ...
1
vote
1answer
129 views

How can I move between words in the command prompt in tcsh in linux?

I want a feature like vim's going forward or backwards command (w,e,ge,b) etc in the shell prompt. I am using tcsh shell in Linux. I would like to go 'n' number of words backs or forward etc and do ...
1
vote
1answer
401 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 ...
2
votes
1answer
151 views

zsh adds tab character when autocompleting

I have zsh 4.3.10 installed on a RHEL 6.4 box. I'm not sure why this happens, but when I but Tab to autocomplete things, it also adds a tab character. For example: rocket@rhelbox www % vim vim ...
1
vote
1answer
137 views

How to change cVLC prompt?

I use cvlc, that is command-line version of VLC media player a lot. It has default prompt of '>' sign. I wonder if it is changeable, and if it is how can I reconfigure it ?
3
votes
1answer
113 views

Bootup prompt for ecryptfs password

Is it possible to setup ecryptfs mounts to prompt for password upon bootup? Say for example /home and /var are ecryptfs folders that need to be mounted; how do I force a prompt upon bootup to ask for ...
-4
votes
3answers
113 views

Linux prompt missing brackets

I'm using centos in my VPS server and guest system. There're two logins for a guest system. One is root and one is regular. After I mounted the guest system and chroot to the mounting directory, I ...
-2
votes
1answer
96 views

bash script user promt for prefered directory

hey all i am attempting my first bash script. so i would like to prompt the user to find out where they would like a cloned repo to be saved currently i am assigning it like this ...
5
votes
3answers
175 views

change prompt formatting based on cwd

I use tcsh. I'd like to have my prompt formatting (coloring/highlighting) change based on the directory I'm in, or other critical aspects of my environment. I'm not enough of a shell hacker to know ...
5
votes
2answers
288 views

Wrap command in the prompt

Is it possible to insert a separator after the command in a prompt? This is an example: ~/Desktop: ls -al ------------------------------------- total 80 drwx------+ 6 eddie staff 204B Apr 29 ...
0
votes
1answer
61 views

can someone fix my PS1 for bash

I seem to have too many colour escapes so it only works in some prompts - can someone please correct for me ? PS1='\[\e[0:35m[\u@\e[0:33m\h\e[m \e[0:35m\w]\e[m \e[0:33m`git branch 2> /dev/null | ...
4
votes
3answers
197 views

What process is running before I even get a prompt?

When I log in to a specific server I see the following: Note that I get get Last login: ... information but no prompt. I hit Ctrl+C and only then do I get my prompt, thus proving that my username ...
3
votes
1answer
252 views

Prompt for confirmation for every command

I'm writing a pretty ad-hoc install script for some thing. No much control constructs, basically just a list of commands. I'd like the user to confirm each command before it gets executed. Is there a ...
4
votes
3answers
151 views

How to customize PS1 properly?

I customized my bash with this in my bashrc export PS1="\e[0;36m\h\e[m \e[0;33m\w/\e[m \e[0;31m\n\$ →\e[m " So I get something like this (with colors) : Ahuri ~/Public/ $ → But I am having ...
1
vote
1answer
143 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
68 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 ...
4
votes
2answers
131 views

Bash Command (History) Number In PS1

I am a noob in bash to be honest. I have Googled around and cannot find an answer to this: history lists previous commands and their number e.g. $ history 286 clear I want to be able to see the ...