5

I have customized my Terminal look a great deal now, and to add the finishing touches I wish to make my gnome-terminal cursor green (it is currently white), however there appears no way to do this in the settings GUI, so how could one achieve this? I am running Ubuntu GNOME 15.04 with GNOME 3.16.

Information Update:

This is the current look of my Terminal:

GNOME Terminal

And I have configured this with:

PS1='${debian_chroot:+($debian_chroot)}\[\033[00;37m\][\[\033[00;32m\]\t\[\033[00;37m\]] \[\033[01;34m\]\u\[\033[00;37m\]@\[\033[01;34m\]\h\[\033[00;37m\]:\[\033[01;34m\]\w\[\033[01;32m\]$ '

In .bashrc.

  • Your font color is green but not you cursor? – A.B. Sep 27 '15 at 18:54
  • @A.B.: Yes, I will update my question with more information. – user364819 Sep 27 '15 at 19:12
  • @A.B.: I was not able to include the cursor in my screenshot, but it is a white block cursor so I am sure that you will know what it looks like. – user364819 Sep 27 '15 at 19:18
  • Ok, I'm understand. – A.B. Sep 27 '15 at 19:21
  • So you want it green and it's currently green? – TheWanderer Sep 27 '15 at 19:23
11

Following command will change terminal cursor to green:

echo -e "\e]12;green\a"

Above command will print extra new line. If no new line required:

echo -ne "\e]12;green\a"

For permanent changes put above command in .bashrc file.

Further if you want to make your cursor visible or invisible:

tput cnorm  # make cursor invisible
tput civis  # make cursor visible

More information can be found at following link:

How do I change the color of current cursor position indicator?

  • How do I get the cursor to stay green permanently? – user364819 Sep 28 '15 at 18:04
  • 1
    Put echo -e "\e]12;green\a" in .bashrc file. – snoop Sep 28 '15 at 18:08
  • Use echo -ne so that it doesn't print a newline. You can use any color with #RRGGBB notation. Make sure to surround the echo with a condition of the output being a terminal: if [ -t 1 ]; then echo ...; fi or the shell being interactive ($- containing i) or something similar, otherwise you'll break inbound scp or rsync (can't remember which, maybe both). – egmont Sep 30 '15 at 21:18
3

Your text color is actually set to white, check it in the profile (menu edit/profile preferences/color ). Your PS1 explicitly returns the "current color" to green, so the text is green, but the PS1 should have it's defining string end in ...]\w\[\033[00m\]\$ to return it to the default color. Change the text color to green in the edit/profile preferences, and to avoid future confusion, use the above string to return to default.

-1

You could try this:

sudo nano #terminal-cursor-ds:#

and then type this in

cusor window color {
   {window frame cursor}
   {color="true"
   {color="green"
}

and then save the file, and then this in the terminal:

sudo apt-get install --reinstall gnome3
sudo dpkg-reconfigure term

and it might work fine this way.

  • Because I am using GNOME ubuntu-desktop is not installed. – user364819 Sep 28 '15 at 17:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy