One of my favorite features of the xfce terminal is that it can automatically set a different color for each terminal instance the user creates. This makes it very easy to differentiate between the different sessions.

Is there any way to achieve a similar sort of functionality in Terminator?

1 Answer 1


The only terminal emulators I'm aware of that conveniently support it out of the box are xfce4-terminal and konsole.

Terminator version 1.90 and above (actually its underlying VTE widget), however, understands the OSC 11 escape sequence to change the background color, e.g.:

echo -ne '\e]11;#abcdef\a'

(and similarly with 10 for foreground).

You might write a chunk of shell script that randomizes the color and emits this sequence from the shell startup script (e.g. .bashrc). Take care to emit it only if the shell is interactive and/or its output is connected to a terminal (see e.g. here).

A quick example, I leave it up to you to improve as you wish:

if [ -t 1 ]; then
  colors=(abcdef cdefab efabcd)
  echo -ne "\e]11;#${colors[i]}\a"

Instead of a random number, it might be a good idea to base the color on the tty line (the number from the output of tty), that way you'll have fewer conflicts.

  • Thank you for your help @egmont! Unfortunately my rep is not high enough on this part of Stack to upvote your answer, but I appreciate your reply!
    – Spectator6
    Feb 9, 2018 at 3:24
  • actually all lua configurable terminal emulator should be able to do this for example wezterm, tym etc. Unfortunately they are too young to be useful.
    – Wang
    Sep 2, 2022 at 15:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .