1
vote
0answers
16 views

Git prompt won't colorize

I want my git prompt in bash to colorize (green for clean repos, red for dirty repos). Right now, it shows plain white text no matter the git state of my cwd/repo. ...
1
vote
1answer
79 views

lxterminal prompt unwanted characters

I'm on fresh Lubuntu 14.04 installation. I am using LXTerminal and this is the prompt I'm setting through .bashrc file: export PS1="\e[0;36m$ \w \e[m" Assume I enter a command up to 15 characters ...
2
votes
1answer
26 views

Ctrl+a doesn't return all the way back in terminal

I recently updated my prompt to look something like [user@User] ~/wroking/directory (git-branch) ↳ using the following code in my .bashrc source ~/.local/bin/git-prompt.sh ...
12
votes
3answers
2k views

What does “${debian_chroot:+($debian_chroot)}” do in my terminal prompt?

In my terminal prompt definition in my .bashrc file, among other things, I have this snippet of code: ${debian_chroot:+($debian_chroot)} What does this do, and do I need it?
1
vote
1answer
357 views

Creating new user, inconsistent bash prompt

I've created a new user profile with: useradd kitty passwd kitty mkdir kitty chmod 0700 kitty chown -R kitty:kitty adduser kitty sudo #when I did it I initially didn't ...
3
votes
2answers
3k views

Changing behavior of bash prompt when functioning as root

Before you click away, this isn't the typical "how do I make my bash prompt have color" question. I've already customized my bash prompt to look like this: [user @ host]----[$(pwd)] $ where ...
4
votes
3answers
2k views

How can I shorten the bash prompt's current path to one letter per directory?

I can't remember where, but I've already seen the bash prompt's current path shortened in an interesting way: every directory contained in the path is replaced by its first letter only. For instance: ...
2
votes
1answer
484 views

Bash Prompt Changes Colors on ls

My prompt is: PS1="\`if [ \$? = 0 ]; then echo \[\e[33m\]':)'\[\e[0m\]; else echo \[\e[31m\]':('\[\e[0m\]; fi\` \e[0;1m\w\e[1m\n\$ " The problem is when I use ls, the prompt changes colors to the ...
3
votes
1answer
102 views

Correct place to put colors of prompt (PS1)

Say I want to change the colors of my PS1, or for the sake of simplicity I just want to change the content, so I want to do this: PS1="touch me : " My problem, doubt is: If I put this in ...
7
votes
2answers
2k views

Long lines overlap in Bash PS1 customized prompt

I have configured a fancy two-line PS1 bash prompt, with server name, time, user name and other useful variables. PS1="\n\[\033[1;34m\]\342\226\210\342\226\210 \u @ $SERVER_NAME""$BBlue"" ...
16
votes
2answers
12k views

How can I shorten my command line (bash) prompt?

Currently it is: michael@Castle2012-Ubuntu-laptop01:~/Dropnot/webs/rails_v3/linker/spec/controllers$ Outside of renaming my machine and directory structure... How could I make it be something ...
2
votes
1answer
2k views

~/.bashrc changes have no effect?

I have been trying to set some custom colors on the user@hostname:~$ on the terminal. I edited both ~/.bashrc and /etc/bash.bashrc Where it said: debian_chroot:+($debian_chroot... I just changed ...
13
votes
2answers
7k views

Changing colors for user, host, directory information in terminal command prompt

Is it possible to change the colors in the command prompt for the user@computer, as well as the the current directory and command parts of the prompt display? I've already seen something like this ...
1
vote
1answer
321 views

How to interpolate a variable immediately after a `$` or `\$` in the bash prompt?

I am using this function: function test(){ local var="hello" PS1="\u\$$var" } The output I am trying to get from the function is john$hello. But what I get is just john. If I add a space ...
2
votes
1answer
893 views

Problem to write long lines in terminal

I have defined a PS1 prompt multi-line in my server with Ubuntu 11.04. The problem occurs when I write a long command, the line cuts before the end of terminal and it continues at beginning the same ...
15
votes
4answers
1k views

How (and where) can one change 'user@host $:' pattern in gnome-terminal?

When I start terminal in Ubuntu, I see: ilya@HOST:~$ I need to add a timestamp to this, something like: 2011-10-09T09:32:00 ilya@HOST:~$ How can I configure this?
4
votes
1answer
307 views

Custom bash prompt is buggy

I followed some articles on how to change the prompt, I've got the result I was looking for, but when the cursor reach the end of the screen it doesn't go new line and tab completion it's strange. # ...
2
votes
1answer
256 views

Anomaly with bash PS1 definition

My root and admin user both have the same .bashrc file. The prompt section of the .bashrc is the following: if [ "$color_prompt" = yes ]; then ...
11
votes
5answers
7k views

trim the terminal command prompt working directory

When using the terminal in a deep folder structure sometimes the prompt can take up most of the line. Is there any way in which I can trim the working directory? I know I can do PS1="\W >" to only ...