Change background colour in Xterm

11,143

I believe you happened to don't have one, so create a file named .Xresources on your home directory:

touch ~/.Xresources

Then add following lines to .Xresources file:

xterm*Background: your_background_color
xterm*Foreground: your_foreground_color

example:

$ cat $HOME/.Xresources
XTerm.vt100.background: black
XTerm.vt100.foreground: grey

See critical.ch/xterm for a list of colors which may be supported in your version of XTerm.

You can either restart X or run xdrb command to apply change you have made:

xrdb -merge ~/.Xresources
xterm
Share:
11,143

Related videos on Youtube

vishal-wadhwa
Author by

vishal-wadhwa

Updated on September 18, 2022

Comments

  • vishal-wadhwa
    vishal-wadhwa over 1 year

    I want to change Xterm's (not the gnome terminal) background colour in Ubuntu 16.04 but there happens to be no title bar. I could not even find the Xresources file.

    Also, I want the colour change to be permanent not just during that session. And one more thing I cannot execute any commands during that session because that Xterm window is being launched by some other program (to be specific that program is "Code Blocks"). Please help me sort out this issue.

    Xterm screenshot:

    enter image description here

  • vishal-wadhwa
    vishal-wadhwa over 7 years
    I did exactly what you explained, just added the colour names (white,black). But it did not help. Still the same.
  • Liso
    Liso over 7 years
    Have you run xrdb ~/.Xresources command ?
  • vishal-wadhwa
    vishal-wadhwa over 7 years
    Since you mentioned that either I should restart X or run xrdb. So I restarted->no good, ran xrdb->no good. ran xrdb and restarted X->worked like a charm. Thank you
  • Admin
    Admin almost 2 years
    Should we keep the () for the color?