1
vote
0answers
17 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 ...
0
votes
1answer
68 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 | ...
8
votes
4answers
6k views

How to make the terminal display user@machine in bold letters?

I have seen in some screen-shots (can't remember where on the web) that the terminal can display the [username@machine /]$ in bold letters. I'm looking forward to getting this too because I always ...
5
votes
1answer
1k 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 ...
4
votes
1answer
537 views

Re-escape brackets in PS1

As others have pointed out, color codes in PS1 should be bracketed by \[ and \] to avoid them taking up horizontal space. I've added the necessary code to .bashrc: highlight() { if [ -x ...