You are not logged in.

#1 2006-07-07 13:00:07

Borosai
Member
From: Sandy Appendix, U.S.A.
Registered: 2006-06-15
Posts: 227

Trouble with .bashrc and custom terminal title bar

I was reading up on .bashrc and customizing the prompt, and decided to add some data to the title bar in X when using a terminal...basically to print out my current working directory and so on. It works perfectly in X, but when not in X, I can see the extra text that isn't supposed to show (from the semicolon on). Below is my entry in .bashrc...maybe I did something wrong.

PS1='[e]2;urxvt    :: u@h : w ::a]:: u@h : W :: [e[1;32m]$[e[0m] '

If there is a better way of doing it (not in .bashrc), please let me know. Thanks.

Offline

#2 2006-07-07 14:13:01

Cerebral
Forum Fellow
From: Waterloo, ON, CA
Registered: 2005-04-08
Posts: 3,108
Website

Re: Trouble with .bashrc and custom terminal title bar

You could check your $TERM variable and set the prompt differently dependent.  $TERM will be 'linux' if you're not in X.

eg.

if [ "$TERM" != "linux" ]; then 
    #add the extra data.
fi

Offline

Board footer

Powered by FluxBB