This site is now 100% read-only, and retired.

Customizing your xterm

Posted by Steve on Thu 30 Dec 2004 at 18:29

xterm is the default terminal emulator, or shell program, that people use when running the X11 Window System. Despite its apparent simplicity it's very customizable, allowing you to change fonts, sizes, and colours with only a little effort.

Many newcomers to Linux don't realise that there are menu options available with xterms and instead seem to believe that they must use the KDE, or GNOME terminal applications to get adjust fonts.

Open up an xterm, and you can see menus by holding down the "Ctrl" key upon your keyboard and clicking upon the body of the window with either your left, right, or center mouse button.

For example if you wish to see to adjust the font you're using you can use "Ctrl + Right mouse button" to show the following menu:

Selecting the options with the mouse will change your currently open window.

Other aspects of your xterms can be configured, such as the background colour and the text colour.

When it comes to changing settings you have two choices:

  • Change settings via command line arguments.
  • Change settings via XResources.

The former is the simplest way of customization, but you don't have the chance to make so many changes.

Simple options such as the size of the window, and it's colours can be achieved such as the following:

xterm -rightbar -bg white -fg black -geometry 80x25

This command opens an xterm with a white background, and a black text (the fg parameter) with a scrollbar upon the righthand side.

More complex settings are possible, and running "man xterm" will give you a good list of command line options to choose from.

When it comes to customizing xterm in a serious way XResources are the way to go, as these will apply to all windows that are opened.

XResources are read from the file ~/.Xresources when you login, but if you wish to force them to be reloaded you run the command:

xrdb -merge ~/.Xresources

Save the following into a file called .Xresources in your home directory, and then run that command:

!
! Comments begin with a "!" character.
!

XTerm*background:       black
XTerm*foreground:       white
XTerm*cursorColor:      white
XTerm.vt100.geometry:   79x25
XTerm*scrollBar:        true
XTerm*scrollTtyOutput:  false

Once you've done this you can open an Xterm and see that the changes have taken effect on all new xterms - even though you've made no command line changes.

Customizing applications with XResources is a difficult subject to get into now, but you can find further information via google ;)

 

 


I found this very useful
Posted by yaarg (81.178.xx.xx) on Tue 11 Jan 2005 at 15:40
[ View Weblogs ]
By default double clicking on a URL in a xterm will only select a part of it but with this tweak it will select the whole thing. xterm*charClass: 33:48,36-47:48,58-59:48,61:48,63-64:48,95:48,126:48 in your ~/.Xresources Very useful if you run a console irc/email client.

[ Parent ]

Re: I found this very useful
Posted by Anonymous (83.98.xx.xx) on Wed 21 Jun 2006 at 12:32
The comment by yaarg on how to enable url selection in xterm is very useful, thanks!

[ Parent ]

Re: Customizing your xterm
Posted by Anonymous (68.126.xx.xx) on Mon 5 Feb 2007 at 02:45
Thanks for the help.

[ Parent ]

Re: Customizing your xterm
Posted by Anonymous (80.195.xx.xx) on Fri 10 Aug 2007 at 07:45
i found this useful but would like a xterm with copy and paste

[ Parent ]

Re: Customizing your xterm
Posted by Anonymous (90.37.xx.xx) on Mon 16 Sep 2013 at 22:33
C-inser to copy
maj-inser to past

[ Parent ]

Re: Customizing your xterm
Posted by Anonymous (192.100.xx.xx) on Wed 30 Jan 2008 at 09:03
"Many newcomers to Linux don't realise that there are menu" ok that was still new for me after 15 years of Linux and likely over 10 years xterm ;)

Found similar "ctrl+mouse" menus also from other programs that I have been using daily, but likely I keep my fingers at keyboard also in future.

[ Parent ]

Re: Customizing your xterm
Posted by Anonymous (71.106.xx.xx) on Fri 25 Sep 2009 at 02:54
I wasn't aware that xterm had menus either. Xresources is what I was looking for. Now to go off and Google Xresources. Simple info on xterm with a lot of tips! Thank you !

[ Parent ]

Re: Customizing your xterm
Posted by Anonymous (193.40.xx.xx) on Wed 10 Feb 2010 at 06:46
These settings also apply to your ~/.Xdefaults file which gets read when logging in.

[ Parent ]

Re: Customizing your xterm
Posted by Anonymous (192.91.xx.xx) on Wed 24 Mar 2010 at 14:43
If you log into more than one system, you can specify which .Xdefaults file is activated by including the name of the system. example for system name of "hal":

.Xdefaults-hal

You can use this feature to customize which system has which look. Helpful to identify which system you are using.

-Lynn

[ Parent ]

Re: Customizing your xterm
Posted by Anonymous (147.210.xx.xx) on Wed 8 Feb 2012 at 10:14
Unfortunately recent debian releases (squeeze and maybe even lenny, I don't remember) do not comply in full with .Xdefaults. For example lines such as
XTerm*scrollBar
are ignored, sigh.
I'm still looking for a fix of this.

[ Parent ]

Re: Customizing your xterm
Posted by Anonymous (88.97.xx.xx) on Thu 26 Apr 2012 at 20:17
As I understand it, I believe .Xdefaults is deprecated - using .Xresources instead is the fix. It might be necessary, in some instances, to use both for a while, but it seems .Xresources is the way to go. If I could find the link where I read about it, I'd post it here.

[ Parent ]