# Chapter 5. Getting the Most out of Terminals, xterm, and X Windows

#### Contents:

There's a Lot to Know About Terminals
The Idea of a Terminal Database
Setting the Terminal Type When You Log In
Querying Your Terminal Type: qterm
Querying Your xterm Size: resize
Checklist: Terminal Hangs When I Log In
Find Out Terminal Settings with stty
Setting Your Erase, Kill, and Interrupt Characters
Working with xterm and Friends
Login xterms and rxvts
Working with Scrollbars
How Many Lines to Save?
Simple Copy and Paste in xterm
Defining What Makes Up a Word for Selection Purposes
Setting the Titlebar and Icon Text
The Simple Way to Pick a Font
The xterm Menus
Changing Fonts Dynamically
Working with xclipboard
Problems with Large Selections
Tips for Copy and Paste Between Windows
Running a Single Command with xterm -e
Don't Quote Arguments to xterm -e

## 5.1. There's a Lot to Know About Terminals

This chapter covers most of what you need to know to set up your terminal or terminal emulator from your shell setup files (Section 3.3).

In the latter half of the chapter, we cover the ins and outs of working with some of the most popular terminal-emulator software for the X Window System, including xterm, rxvt, and others, where applicable. The list of terminals and emulators you might come into contact with is long and getting longer, though, so the advice we give in the first section of the chapter regarding how to configure your terminal will be helpful. As you find yourself suddenly confronted with the prospect of configuring the terminal emulator on your cell phone or tablet computer, remember: you can usually make it work, with enough time and effort.

It is important to remember, however, that the tricks and tips we discuss in this chapter, if implemented incorrectly, may cause your terminal to hang. One way around a hung terminal is always to keep at least one other terminal emulator window, with sane settings, open all the time you're modifying the setup of the other. That way, if you hang up the terminal you're actively modifying, you can always go back to the other and save yourself. On systems that support virtual consoles, such as Linux, you can also use command keys (e.g., ALT and the first five function keys) to switch between various virtual consoles, just as you might with a terminal emulator. Don't just reach for the power switch!

--TOR and SJC

Copyright © 2003 O'Reilly & Associates. All rights reserved.