LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-12-2007, 08:59 AM   #1
ab25
LQ Newbie
 
Registered: Dec 2007
Posts: 15

Rep: Reputation: 0
how to change appearance in terminal?


Dear friends,

I want to change the appearance of terminal/ bash shell. I want to put my name at the begining of the bash shell/terminal every time its opened.(So I like to put anything at the beginning of the skin of terminal).How can I manage to do it? How can I change the appearance of terminal permanently?
regards
 
Old 12-12-2007, 09:27 AM   #2
helptonewbie
Member
 
Registered: Aug 2006
Location: England Somewhere
Distribution: Mandriva, PCLinuxOS, Karoshi, Suse, Redhat, Ubuntu
Posts: 518

Rep: Reputation: 39
Hello,
It depends on the shell you are using, for bash you can edit the .bashrc for yourself and add in the following:

PS1="MyNameIS >"


something like that will mean in any bash shell you open you will see:
MyNameIS >
as the prompt.
Use this website to help you:
http://lantech.geekvenue.net/chuckti...302/index_html
Regards

ps-you could make it system wide by editing your /etc/profile, however the .bashrc of a user will override this i think?!?

Last edited by helptonewbie; 12-12-2007 at 09:29 AM.
 
Old 12-12-2007, 10:08 AM   #3
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
The advice from helptonewbie is correct for setting the shell prompt. If you want to customize the title of the terminal window, again it depends from the shell you are using. In bash, you have to go through the PROMPT_COMMAND variable: it contains a command to execute before the prompt. As an example, on one system of mine - running GNOME and using BASH - I have
Code:
PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}"; echo -ne "\007"'
The blue part is what tells to customize the title of the terminal, where \033 is the ascii code for ESC and \007 is the ascii code for BELL. In other words when you have prompt commands like these
Code:
\033]0;any_string_here\007
\033]1;any_string_here\007
\033]2;any_string_here\007
the terminal title and icon name, or the icon name only, or the terminal title only, will be set to any_string_here respectively. In the example above the terminal and icon title will be dynamically set to
Code:
user@hostname:current_directory
The variable PROMPT_COMMAND is set in /etc/bashrc, but - as helptonewbie suggested - you can set its value in ~/.bashrc to override the system behavior on a per-user basis. The last step is to correctly setup the default profile used by the terminal: in gnome-terminal this can be done by clicking on Edit --> Current Profile --> Title and Command and set "Dinamically-set title" to "Replaces initial title".
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Change appearance of GRUB Norab Linux - Software 8 08-29-2005 07:09 PM
How to change default Xterm behaviour/appearance? polemon Linux - Newbie 4 07-24-2005 10:00 PM
Way to change tooltips appearance? z-vet Linux - General 1 12-27-2004 04:14 AM
change nautilus appearance andymadigan Linux - Software 3 08-08-2004 03:44 PM
Change appearance of command prompt Irving Linux - Software 2 06-09-2004 10:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:14 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration