Difference between revisions of "Xterm"

From ArchWiki
Jump to: navigation, search
(Tips: Removed 'My Alt key doesn't work correctly')
(Basics: Added 'Scrolling' subsection)
Line 20: Line 20:
 
If you use ''readline's ''{{Keypress|Alt+d}}, {{Keypress|Alt+f}} and {{Keypress|Alt+b}} at the command line, you will need this in your resource file:
 
If you use ''readline's ''{{Keypress|Alt+d}}, {{Keypress|Alt+f}} and {{Keypress|Alt+b}} at the command line, you will need this in your resource file:
 
  XTerm*metaSendsEscape: true
 
  XTerm*metaSendsEscape: true
 +
 +
===Scrolling===
 +
As new lines are written to the bottom of the xterm window, older lines disappear from the top.  The saved lines can be redisplayed by scrolling.  By default, 1024 lines are saved.  You can change the number of saved lines with the {{ic|saveLines}} resource,
 +
Xterm*saveLines: 4096
 +
 +
Other X resources that affect scrolling are {{ic|jumpScroll}}, set to {{ic|true}} by default, and {{ic|multiScroll}} and {{ic|fastScroll}}, both of which default to {{ic|false}}.
  
 
==Tips==
 
==Tips==

Revision as of 11:45, 10 March 2013

xterm is the standard terminal emulator for the X Window System. It is highly configurable and has many useful and some unusual features.

Basics

Resource file settings

There are several options you can set in your X resources files that may make this terminal emulator much easier to use.

TERM Environmental Variable

Allow xterm to report the TERM variable correctly. Do not set the TERM variable from your ~/.bashrc or ~/.bash_profile or similar file. The terminal itself should report the correct TERM to the system so that the proper terminfo file will be used. Two usable terminfo files are xterm, and xterm-256color.

  • Without setting TERM explicitly, xterm should report $TERM as xterm. You can check this from within xterm using either of these commands:
$ echo $TERM
$ tset -q
  • When TERM is not set explicitly, color schemes for some programs, such as vim, may not appear until a key is pressed or some other input occurs. This can be remedied with this resource setting :
xterm*termName: xterm-256color

UTF-8

Make certain your locale settings are correct for UTF-8. Adding the following line to your resource file will then make xterm interpret all incoming data as UTF-8 encoded:

XTerm*locale: true

Fix the 'Alt' key

If you use readline's Template:Keypress, Template:Keypress and Template:Keypress at the command line, you will need this in your resource file:

XTerm*metaSendsEscape: true

Scrolling

As new lines are written to the bottom of the xterm window, older lines disappear from the top. The saved lines can be redisplayed by scrolling. By default, 1024 lines are saved. You can change the number of saved lines with the saveLines resource,

Xterm*saveLines: 4096

Other X resources that affect scrolling are jumpScroll, set to true by default, and multiScroll and fastScroll, both of which default to false.

Tips

Automatic transparency

Install the package transset-df and a composite manager like Xcompmgr.

Add the following line to your ~/.bashrc:

[ -n "$XTERM_VERSION" ] && transset-df -a >/dev/null

Now, each time you launch a shell in an xterm and a composite manager is running, it will become transparent. the test in front of the transset-df command keeps it from executing if that variable is not defined. Note that your terminal will not be transparent if you launch a program other than the shell this way. It is probably possible to work around this if you want the functionality.

See Also

Xterm menu

Xterm has a hidden menu that can be viewed by holding the Template:Keypress key and pressing the first mouse button (left click) on a Xterm window.

Enable bell urgency

Add the following line to your ~/.Xresources file:

xterm*bellIsUrgent: true

Remove black border

Xterm has a black border in some cases, you can disable this by adding the following line to your ~/.Xresources file.

xterm*borderWidth: 0

Change background and font color

First you make an Xresource file which is a regular textfile and it is described at X resources. You find a color you like at http://www.colorpicker.com/ and copy the 6 alphanumerical above the picture. Then to change your background you add

xterm*background: #<alphanumeric>

and for the font you add

xterm*foreground: #<alphanumeric>

Notice the casing on xterm. It did not work for me with XTerm or Xterm. Also after you make changes and do

xrdb -merge /path/to/Xresources

or

xrdb /path/to/Xresources

you have to start a new xterm window to see the changes.

Hide the scrollbar

In order to hide xterm's scrollbar, add the following to your .Xresources/.Xdefaults file.

xterm*scrollBar: off