Customizing your xterm

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

Tags: , ,

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 ;)

Share/Save/Bookmark


Posted by yaarg (81.178.xx.xx) on Tue 11 Jan 2005 at 15:40
[ Send Message | 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 | Reply to this comment ]

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 | Reply to this comment ]

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

[ Parent | Reply to this comment ]

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 | Reply to this comment ]

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 | Reply to this comment ]

User Login

Username:

Password:

[ Advanced Login ]

Register Account

Quick Site Search