Results 1 to 7 of 7

Thread: Color-coding of Gnome Terminal

Hybrid View

  1. #1
    Join Date
    Apr 2007
    Location
    United States
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Color-coding of Gnome Terminal

    Hello,

    I would like to color-code text in Gnome terminal. More specifically, I would like to change the color of text, that I input in terminal in yellow, and do not change the output and leave as it is.

    Also, if it's possible I'd like to make color of username "name@laptop $" green, for that I could easily find it.

    Is it possible at all?

    I saw one picture with settings like this, but it's a terminal in windows and not linux. Here's the picture:

    http://www.mplayerhq.hu/images/scree...ndowsXP-01.jpg

  2. #2
    Join Date
    Mar 2006
    Location
    America
    Beans
    97
    Distro
    Ubuntu 7.04 Feisty Fawn

    Re: Color-coding of Gnome Terminal

    There is a file called .bashrc in your home direcory that is executed whenever you start a shell. The variable, PS1 contains your prompt. Color codes are escaped, for more detail, look here.

    The command to add in ~/.bashrc is:
    PS1='${debian_chroot:+($debian_chroot)}\[\033[0;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
    But before you add that, read through the script and you should notice that it's already in there and just needs to be uncommented.

  3. #3
    Join Date
    Mar 2006
    Location
    Dallas, TX
    Beans
    367
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Re: Color-coding of Gnome Terminal

    I was looking for something like that too. Thanks for starting the thread O-pos and thanks for the reply Fryer Fox.
    Hello..my name is Nono
    Linux User #415998

  4. #4
    Join Date
    Apr 2007
    Location
    United States
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Color-coding of Gnome Terminal

    Thanks. with the green prompt it worked super, but when I change the color of the text to yellow, it changes the whole text to yellow. But I want input text yellow, output - standard, white.

    ??

  5. #5
    Join Date
    May 2007
    Beans
    244
    Distro
    Ubuntu 7.04 Feisty Fawn

    Re: Color-coding of Gnome Terminal

    If it's possible to do what you want, the answer should be in here: http://tldp.org/HOWTO/Bash-Prompt-HOWTO/

    Don't change the colors in the gnome-terminal settings. Well, I mean, change them if you want... but that's not the correct place to change them to get the sort of effect that you want.

    Good luck!

  6. #6
    Join Date
    Mar 2006
    Location
    Dallas, TX
    Beans
    367
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Re: Color-coding of Gnome Terminal

    Man, that is an awesome link.
    Hello..my name is Nono
    Linux User #415998

  7. #7
    Join Date
    May 2008
    Location
    Bucharest, Romania
    Beans
    57
    Distro
    Ubuntu

    Smile Re: Color-coding of Gnome Terminal

    The quickest way:
    Open Gnome Terminal and:
    1. gedit .bashrc
    2. Search for line containing :"#force_color_prompt=yes" and change it to
    "force_color_prompt=yes" (delete hash)
    3. save, close gedit, close and reopen terminal !

    Simple, no ?

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •