Why I use RXVT as my terminal

Seth Kenlon

I'm a fan of Konsole and Gnome Terminal, and I use them both regularly. They're great projects, and they represent modern terminals that meet the needs of users who spend their day in a shell, as well as users who only dip into a UNIX shell every now and again. They integrate nicely into a desktop environment, bridging the gap between common GUI tasks and common shell tasks. I use Gnome Terminal at work and Konsole at home, and I enjoy them both. However, one of the terminals I was introduced to was the

rxvt-unicode

, and its simplicity, portability, and extensibility has kept me a user ever since starting with Slackware Linux 12.

Here's why, and more importantly, how I use `rxvt` as my default terminal.

Lightweight

Furthermore, one of my personal budgeting tricks (and contributions to the environmentally-friendly idea of

repair

and

reuse

) is to never buy new hardware, but "rescue" a perfectly usable computer for my personal laptop (My personal laptop was an "upcycled" 2004 iBook (running

Debian Linux

) up until its screen became irreparable in 2017.) One of the distinct advantages of open source is that you can run all the latest requisite software, with all the latest security patches, using lightweight applications. These applications, the desktop itself included, barely touch precious system resources that are typically limited on aging computers. The `rxvt` terminal is relatively tiny; a little heftier than `xterm` but a lot less demanding than Gnome Terminal and Konsole.

Distinct

A simple terminal helps separate functions of the desktop (like drag-and-drop, which `rxvt` does *not* provide) from functions of the terminal (things you can do, for instance, over SSH). Users new to working on remote systems can get confused about what exactly the terminal represents, especially when it's so nicely integrated into the rest of their computer. Sometimes, maintaining a distinct separation between the local environment and remote systems happens to be useful. Of course, this isn't at all by intention; it's an arguable shortcoming of `rxvt` and similar simple terminal emulators that they don't accept drag-and-drop actions or provide fancy contextual menus (more on that later), but it can be a surprising benefit.

Furthermore, learning a simple terminal interface forces you to expand what you think of as a usable interface. Once you've learned to use `rxvt` effectively, you might find that `eshell` and `xterm` and even the humble `TTY` interface serve their purpose. You learn to use low spec terminals because your idea of what a terminal *needs* and what's only *nice to have* has shifted toward simplicity.

Installing rxvt

The fork of `rxvt` I recommend is usually called `rxvt-unicode` in your software repository, and may provide a launcher called `urxvt` or similar. It's a small application and doesn't require much to build from source code, but most Linux distributions provide it, so it can be installed with your package manager. On Fedora, CentOS, or RHEL:

On Debian and Ubuntu:

On others, such as Slackware, `rxvt` may already be included.

The default `rxvt` interface is [deceptively] simple and rather plain.

The default rxvt interface [IMG]

You might be used to adjusting this in a Preferences panel on Gnome Terminal or Konsole, but for `rxvt` you make changes in a text file.

Customizing rxvt

One of the beauties of `rxvt` is its plain text configuration file containing `xrdb` properties. The `xrdb` subsystem is the X server resource database utility, which manages user preferences for X11 applications. It's customary to place your preferences in a file called `~/.Xdefaults` and then to merge those preferences into the `xrdb` database.

The easiest target are the basic colors. To see what colors are available to define, along with many other properties of `rxvt`, refer to the man page:

For the appearance of the windows, the man page identifies the prefix `URxvt` followed by colors `0` through `15`. Using hex codes from any Linux

color picker

, you can set your own tone for each ANSI color. Here's a solarized theme, with comments:

With so many colors for your text, you may prefer a dark background. With `rxvt-unicode`, you can even set a partially transparent background with some percentage of opacity (100 being fully opaque and 0 being invisible).

You can also set fonts to any font you have installed on your system. For instance, to set your font to

Fantasque Sans Mono

at 21 points:

To implement changes in `.Xdefaults`, run the `xrdb` command:

And then relaunch `xrvt`. Here are the results (notice that the wallpaper of my desktop shows through slightly):

rxvt with a custom color theme applied [IMG]

You can also customize the scrollbar appearance:

There are many more options available, as listed in the rxvt manual, so try the ones that appeal to you. To see all `URxvt.` properties, type:

As you try `rxvt`, some of the first things you notice are that it doesn't support certain modern conventions, such as **Ctrl**+**C** to copy, **Ctrl**+**V** to paste, or dragging-and-dropping, or a right-click contextual menu, and so on. However, things are not necessarily as they seem, because `rxvt` has a rich set of features, they're simple "hidden" (from a modern point-of-view, at least) in a paradigm you may not be used to.

Copy and paste

When you want to copy and paste, there are a few different ways to do it. The "obvious" way to an experienced Linux user is the X Window System trick of clicking the middle button to paste the contents of your primary clipboard. However, `rxvt` provides more than just that: press and hold **Ctrl**+**Right Mouse Button** over a selection in `rxvt` and a contextual menu appears, with options for copying and pasting. Once the menu appears, you may release the **Ctrl** key but you must keep the right mouse button pressed until making your selection.

Convert newlines to spaces

Sometimes you type out a function or loop in your shell, or you copy one from a website, but then you decide you need to edit it in some way before running it. The problem is, a command with line breaks in it is notated with **>** characters:

When you paste that into your terminal, new **>** characters are inserted at each newline character, resulting in this:

You can edit it out, but it's a little cumbersome to work across lines in a terminal because it uses the up and down arrows to cycle through your history. You could run the command and then cycle back up to it in history, which converts multi-line commands to one line, but you don't always want to run a command so you can edit it.

When pasting something from a website, you may run into a related problem: a sequence of commands may not have **>** symbols, but they probably have embedded newline characters that, when pasted, prompts your terminal to run the command immediately.

A nice bonus feature of `rxvt` is the `newline to spaces` option in the **Selection** menu. This edits the contents of your clipboard so that newline characters become spaces, meaning that a code block is reduced down to one easily editable line when you paste it into `rxvt`. Commands you're pasting in from a website lose any embedded newline characters, so they don't automatically execute after you paste them in. This does *not* convert **>** characters to spaces, so you'll still have to edit those out if they're there, but doing so is a lot easier with everything on one line.

The `newlines to spaces` feature is one of those minor features I use all the time, because I'm almost always leaving notes to myself in folders with which command needs to be run to accomplish some irregular task that I only do on occasion. Inevitably, I end up wanting to modify the command when I re-run it, so it's nice to be able to ensure that the command is easy to edit before I execute it. This feature alone may be the real reason I've stayed with `rxvt` all these years.

Settings menu

For quick access to common terminal setting options, press **Ctrl**+**Middle Mouse Button** to toggle on and off the **Options** menu. This menu lets you set whether your cursor blinks, whether the terminal uses a visual bell, and many other preferences that can be set in your `.Xdefaults` file. Unlike the **Selection** menu, this menu persists as a floating menu until you press **Ctrl**+**Middle Mouse Button** again.

Launch cheats

Another great feature of `rxvt` is that it can be quickly customized at launch time with command options. I use this any time I know I'm going to spend a lot of time in an SSH session to a remote host, because I want it to be abundantly clear as to which terminal contains which session (there's nothing worse than a `sudo poweroff` command issued to the production server instead of the dev server). Regardless of how you've themed your default `rxvt`, you can launch an `rxvt` terminal with any variety of foreground, background, and cursor color (`-fg`, `-bg`, and `-cr`, respectively). You can also add a border for added emphasis:

Rxvt launched with a custom theme [IMG]

I tend to keep things simple: I use red for a production server, green for a development server, and yellow for a test or some other remote system.

There are many options you can use to override your defaults at launch. To see them all, refer to the rxvt manual.

Tabs

The `rxvt` terminal is extensible through Perl. Whether or not you know Perl yourself is largely irrelevant, because many of the features provided by Perl are already bundled along with `rxvt` in `/usr/lib64/urxvt/perl/`.

One of my favourite extensions is the tabbed interface, which is a relatively modern convention of terminal emulators that nobody should have to do without, `rxvt` users included. To activate the tabbed interface in `rxvt`, open `~/.Xdefaults` and add these configuration lines:

Merge your configuration with `xrdb` and then relaunch `rxvt`.

Rvxt with tabs [IMG]

After relaunching, you have a tab index at the top of your terminal. The default entries are `[NEW]` and `1`. These entries are clickable. You can click the `[NEW]` entry to open a new tab, and you can click on a number to switch to that tab.

You can also interact with your tabs using just the keyboard:

There are many more Perl extensions that you can and should try. For instance, the **kuake** extension shows and hides your `rxvt` terminal at the press of a global hot key (**Ctrl**+**F10** by default).

Click navigation

Most terminals don't act very much like text editors, even though that's pretty much what they look like. For instance, if you start a command such as `echo ello` and then decide that you meant to type `hello`, you can't just click on the `e` to send your cursor there for a quick edit. Instead, you have to press the **Left Arrow** key four times, or maybe you know the shortcut **Alt**+**B** to back up one string. The `rxvt` terminal changes that.

In `rxvt`, you can press **Shift**+**Left Mouse Button** to reposition your cursor anywhere on the same line of a command you're typing. The way `rxvt` accomplishes this is by calculating and then issuing the number of cursor-left or cursor-right keypresses required for the cursor to change its location. The result is an experience familiar to anyone who's ever used any text editor, and it's a small and quick convenience that you'll come to appreciate even if you don't use it all the time (after all, it does require your fingers to move away from your keys).

Features features features

There are more features in `rxvt` than the ones listed here. The way to find them is to use `rxvt` as your terminal, and look for ways to solve the things that annoy you about working in a terminal or working with an old "out-dated" one like `rxvt`. You'll be surprised at what you find.

Proxied content from gemini://sdf.org/klaatu/geminifiles/rxvt.gmi (external content)

Gemini request details:

Original URL
gemini://sdf.org/klaatu/geminifiles/rxvt.gmi
Status code
Success
Meta
text/gemini
Proxied by
kineto

Be advised that no attempt was made to verify the remote SSL certificate.