Basti’s Buggy Blog

Poking at software.

urxvt and Emacs - The Ultimate Guide

One of the major advantages of Emacs is that in addition to working on graphical interfaces, it can be used from a terminal as well. However, some features (such as many keybindings) are not available when using Emacs in terminals, due to ancient protocol limitations. This post shows how to make the most of Emacs on a terminal (urxvt).

Table of Contents

“I don’t care about the why, just show me how!"
I got you

The Goal

The objective is to get all Emacs keybindings to work when running emacs inside the urxvt terminal. The following video demonstrates that emacs running in urxvt can distinguish between C-p and C-S-p:

A video of emacs in action. Notice that C-p and C-S-p are handled differently.

The following table1 shows all the mappings that can work with emacs in the terminal:

Modifiers Description
S Space key with shift
C [2-8] (note: xterm.el supports other key binds)
C-S [A-Z]
C-M “g” and space keys
M-S [A-Z]
C-M-S [A-Z]
s or s-S from space to “~” (almost 8 bits characters without control sequences)
H or H-S same as s-S, but use Hyper modifier

Emacs and Terminal Keybindings

If you are an Emacs user, you might have noticed that some keybindings do not work when starting Emacs without a window system (-nw or --no-window-system). The explaination is relatively simple: Whereas the Emacs instance running under X11 has access to all keyboard events (keyup, keydown) etc., the instance running in a terminal emulator is much more limited. Among other shortcomings, Emacs running inside a terminal cannot distinguish between C-<key> (ctrl + key) and C-S-<key> (ctrl + shift + key)!

Try it for yourself: open a new terminal and execute the cat command. All terminal input will now be provided to the cat command as stdin and echoed back stdout and therefore your terminal. Now press C-o and C-S-o and observe the difference (spoiler: there is none).

sh@dsh ~ cat # press C-o followed by C-S-o afterwards

What’s up with the ^ characters? Those characters are used in combination with [A-Z] characters in order to display ASCII control characters in caret notation. You might have seen this in utilities like less, which show the caret notation for non printable characters like the windows carriage return ^M. But what exactly are they there for?

Let’s do a little test and insert all literal C-<key> sequences in alphabetical order into an Emacs buffer. We can prefix our ctrl + key commands with C-q to do a quoted insert and prevent Emacs from executing keybindings associated with the input. You will see two things:

  1. The entered characters have a special font face as they represent non printable bytes
  2. The characters ^I and ^J seem to be missing (more on that in a bit)

If you did the steps above, your buffer should look like this:


Let’s inspect it further by using the emacs-integrated hex editor: hexl-mode! This allows us to see the underlying byte representation of those characters we just typed.

87654321  0011 2233 4455 6677 8899 aabb ccdd eeff  0123456789abcdef
00000000: 0102 0304 0506 0708 090a 0b0c 0d0e 0f10  ................
00000010: 1112 1314 1516 1718 191a                 ..........

We can see that the characters we typed are represented by the bytes 0x01-0x1a. We can have a look into the ASCII table to reveal their meaning. (The table also includes 0x1b-0x1f)

Hex Term Description
0x01 ^A start of heading
0x02 ^B start of text
0x03 ^C end of text
0x04 ^D end of transmission
0x05 ^E enquiry
0x06 ^F acknowledge
0x07 ^G bell
0x08 ^H backspace
0x09 horizontal tab
0x0a new line
0x0b ^K vertical tab
0x0c ^L new page
0x0d ^M carriage return
0x0e ^N shift out
0x0f ^O shift in
0x10 ^P data link escape
0x11 ^Q device control 1
0x12 ^R device control 2
0x13 ^S device control 3
0x14 ^T device control 4
0x15 ^U negative acknowledge
0x16 ^V synchronous idle
0x17 ^W end of block
0x18 ^X cancel
0x19 ^Y end of medium
0x1a ^Z substitute
0x1b ^[ escape
0x1c ^\ file separator
0x1d ^] group separator
0x1e ^^ record separator
0x1f ^_ unit separator
0x7f ^? delete

If you look at the hex-codes 0x09 and 0x0a (where ^I and ^J should have been), you can see that those characters represent a horizontal tab and a new line. This explains why we cannot see them in our emacs buffer. Instead of displaying the control characters in caret notation, emacs simply renders them as a tab and a newline!

As you can see, there are no ASCII control characters represented by a caret and a lowercase character. Therefore the terminal simply can not distinguish between a C-<key> and a C-S-<key> keypress.

Aside: How the Terminal handles control characters

Before looking for a way to work around this limitation, let us learn about the handling of those control characters a bit more.

While the process behind handling a ^C (end of text in ASCII) input is more complicated, it leads to a SIGINT signal being sent. It shows that the meaning behind the ASCII characters has changed over the course of the last decades and should not be take literally. You can check how your terminal interprets those control characters by executing the command stty -a:

sh@dsh ~ stty -a
speed 38400 baud; rows 93; columns 365; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; discard = ^O; min = 1; time = 0;
-parenb -parodd -cmspar cs8 -hupcl -cstopb cread -clocal -crtscts
-ignbrk brkint ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl -ixon -ixoff -iuclc -ixany imaxbel iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke -flusho -extproc

As you can see ^C is translate into “intr”, which causes a SIGINT to be sent.

How urxvt Solves This Problem

Both, xterm and urxvt, can work around this limitation by being able to capture the keyboard input from the X window system, just like Emacs does in X11 mode. This however is the case for most terminal emulators. The difference that makes xterm and urxvt stand out is their configurability and key-remapping capabilities. Instead of handling the key sequence C-p and C-S-p both as ^P, two distinct actions can be executed.

The idea is to configure both – Emacs and urxvt – in a way that:

  1. The pressed key sequence can be uniquely represented by control characters in the terminal
  2. Emacs is able to translate the control characters back to the original key sequence
the keypress is translated into control characters by urxvt and translated back into a keypress by emacs

Key translation through urxvt and Emacs

Of course I’m not the first one to discover this possibility since the package xterm-keybinder aims to solve this exact problem. The rest of the article will focus on how xterm-keybinder works under the hood and how to configure it.

Configuring urxvt

The emacs package xterm-keybinder aims to provide the translation logic for both previously described translation steps.

For the first translation step (keypress to control characters), the package provides a start script which starts urxvt with the right configuration. You can either use this script, or move the configuration into the .Xdefaults file if you want this configuration by default. I recommend using the .Xdefaults file.

As you can see below, the urxvt configuration remaps several key-combinations, which previously could not be represented in the terminal. The mapping follows a specific scheme:

! ...
URxvt.keysym.Mod3-S-0x46: string:^[[======F   ! Mod3-S-F
URxvt.keysym.Mod4-S-0x46: string:^[[=====F    ! s-S-F
URxvt.keysym.C-S-0x46: string:^[[=F           ! C-S-F
URxvt.keysym.M-S-0x46: string:^[[===F         ! M-S-F
URxvt.keysym.C-M-S-0x46: string:^[[==F        ! C-M-S-F
! ...

excerpt from the ~/.Xdefaults configuration

In the example above, urxvt is configured to map the non-terminal-representable key-combinations ending in -F to sequences lead by a control character. You might wonder about the red ^[ (=“escape”/ESC) control character. In Emacs, emitting this control character is equal to pressing Meta (e.g. M-f is equal to ESC f).

In our example whenever C-S-F is pressed, urxvt emits the sequence M-[ [ = F. You can confirm this by using cat in your terminal:

sh@dsh ~ cat # press C-S-f afterwards

If you would open your emacs -nw now and tried to press C-S-f, you’d disappointedly notice that Emacs does not recognize this input yet. In fact, if you try to type that key combination manually inside Emacs, you should notice that the key combination is not used (unless you configured it otherwise).

Configuring Emacs

To make Emacs translate the control characters back to the original key-combination, some more work is necessary. You could manually register the sequences that are defined in the ~/.Xdefaults configuration, but that would be very elaborate.

As a proof-of-concept, let’s define two sequences (for multicursor) by hand in urxvt and in Emacs:

the keypress is translated into control characters by urxvt and translated back into a keypress by emacs

Key translation of C-S-< through urxvt and Emacs

URxvt.keysym.C-S-0x3c: string:^[[=<   ! C-S-<
URxvt.keysym.C-S-0x3e: string:^[[=>   ! C-S->


(define-key input-decode-map "\033[=<" (kbd "C-S-<"))
(define-key input-decode-map "\033[=>" (kbd "C-S->"))


This is enough to get the two keybindings working! To automatically setup all other keybindings, refer to the xterm-keybinder documentation1 and the complete configuration files below.

Complete Configs

If you don’t care about the details, you should be able to get up and running if you integrate the following configuration into your ~/.emacs and your ~/.Xdefaults file.

When making changes to the ~/.Xdefaults file, reload the configuration and restart urxvt:

xrdb -remove ~/.Xdefaults && xrdb -load ~/.Xdefaults


Note: the emacs configuration does not require use-package, I’m just using it out of convenience.

(use-package xterm-keybinder
  (require 'cl-lib)
   '(lambda ()
      ;; enable mouse interaction

      ;; if the terminal was inited by the terminal-init-rxvt, the
      ;; terminal is a rxvt terminal => trigger keybinding init
      (cl-case (assoc-default 'terminal-initted (terminal-parameters))
        ;; if the init function for rxvt was executed, this likely is a rxvt terminal
         ;; check if the terminal is urxvt with 256color
         (when (equal "rxvt-unicode-256color" (getenv "TERM" (selected-frame)))
           ;; setup the keybindings for urxvt

           ;; register some missing keybindings
           (define-key input-decode-map "\033[=<" (kbd "C-S-<"))
           (define-key input-decode-map "\033[=>" (kbd "C-S->")))))

      ;; workaround: terminal has already been initialized, but color
      ;; scheme is wrong for my theme, this fixes the color scheme
      ;; set the font face for the background to white
      (set-face-background 'default "unspecified-bg" (selected-frame)))))

~/.emacs configuration file


Note: this configuration contains more than the minimal configurations required to make urxvt work.

! URxvt.keysym.Mod3-S-0x20: string:[====== 
! URxvt.keysym.Mod4-S-0x20: string:[===== 
URxvt.keysym.Mod3-S-0x21: string:[======!
URxvt.keysym.Mod4-S-0x21: string:[=====!
URxvt.keysym.C-S-0x21: string:[=!
URxvt.keysym.Mod3-S-0x22: string:[======
URxvt.keysym.Mod4-S-0x22: string:[=====
URxvt.keysym.C-S-0x22: string:[=
URxvt.keysym.Mod3-S-0x23: string:[======#
URxvt.keysym.Mod4-S-0x23: string:[=====#
URxvt.keysym.C-S-0x23: string:[=#
URxvt.keysym.Mod3-S-0x24: string:[======$
URxvt.keysym.Mod4-S-0x24: string:[=====$
URxvt.keysym.C-S-0x24: string:[=$
URxvt.keysym.Mod3-S-0x25: string:[======%
URxvt.keysym.Mod4-S-0x25: string:[=====%
URxvt.keysym.C-S-0x25: string:[=%
URxvt.keysym.Mod3-S-0x26: string:[======&
URxvt.keysym.Mod4-S-0x26: string:[=====&
URxvt.keysym.C-S-0x26: string:[=&
URxvt.keysym.Mod3-0x27: string:@h
URxvt.keysym.Mod4-0x27: string:@s
URxvt.keysym.C-0x27: string:@c
URxvt.keysym.Mod3-S-0x28: string:[======(
URxvt.keysym.Mod4-S-0x28: string:[=====(
URxvt.keysym.C-S-0x28: string:[=(
URxvt.keysym.Mod3-S-0x29: string:[======)
URxvt.keysym.Mod4-S-0x29: string:[=====)
URxvt.keysym.C-S-0x29: string:[=)
URxvt.keysym.Mod3-S-0x2a: string:[======*
URxvt.keysym.Mod4-S-0x2a: string:[=====*
URxvt.keysym.C-S-0x2a: string:[=*
URxvt.keysym.Mod3-S-0x2b: string:[======+
URxvt.keysym.Mod4-S-0x2b: string:[=====+
! URxvt.keysym.C-S-0x2b: string:[=+
URxvt.keysym.Mod3-0x2c: string:@h,
URxvt.keysym.Mod4-0x2c: string:@s,
URxvt.keysym.C-0x2c: string:@c,
URxvt.keysym.Mod3-0x2d: string:@h-
URxvt.keysym.Mod4-0x2d: string:@s-
! URxvt.keysym.C-0x2d: string:@c-
URxvt.keysym.Mod3-0x2e: string:@h.
URxvt.keysym.Mod4-0x2e: string:@s.
URxvt.keysym.C-0x2e: string:@c.
URxvt.keysym.Mod3-0x2f: string:@h/
URxvt.keysym.Mod4-0x2f: string:@s/
URxvt.keysym.Mod3-0x30: string:@h0
URxvt.keysym.Mod4-0x30: string:@s0
URxvt.keysym.C-0x30: string:@c0
URxvt.keysym.Mod3-0x31: string:@h1
URxvt.keysym.Mod4-0x31: string:@s1
URxvt.keysym.C-0x31: string:@c1
URxvt.keysym.Mod3-0x32: string:@h2
URxvt.keysym.Mod4-0x32: string:@s2
URxvt.keysym.C-0x32: string:@c2
URxvt.keysym.Mod3-0x33: string:@h3
URxvt.keysym.Mod4-0x33: string:@s3
URxvt.keysym.C-0x33: string:@c3
URxvt.keysym.Mod3-0x34: string:@h4
URxvt.keysym.Mod4-0x34: string:@s4
URxvt.keysym.C-0x34: string:@c4
URxvt.keysym.Mod3-0x35: string:@h5
URxvt.keysym.Mod4-0x35: string:@s5
URxvt.keysym.C-0x35: string:@c5
URxvt.keysym.Mod3-0x36: string:@h6
URxvt.keysym.Mod4-0x36: string:@s6
URxvt.keysym.C-0x36: string:@c6
URxvt.keysym.Mod3-0x37: string:@h7
URxvt.keysym.Mod4-0x37: string:@s7
URxvt.keysym.C-0x37: string:@c7
URxvt.keysym.Mod3-0x38: string:@h8
URxvt.keysym.Mod4-0x38: string:@s8
URxvt.keysym.C-0x38: string:@c8
URxvt.keysym.Mod3-0x39: string:@h9
URxvt.keysym.Mod4-0x39: string:@s9
URxvt.keysym.C-0x39: string:@c9
URxvt.keysym.Mod3-S-0x3a: string:[======:
URxvt.keysym.Mod4-S-0x3a: string:[=====:
URxvt.keysym.Mod3-0x3b: string:@h;
URxvt.keysym.Mod4-0x3b: string:@s;
URxvt.keysym.C-0x3b: string:@c;
! custom C-S-<
URxvt.keysym.C-S-0x3c: string:[=<
URxvt.keysym.Mod3-S-0x3c: string:[======<
URxvt.keysym.Mod4-S-0x3c: string:[=====<
URxvt.keysym.Mod3-0x3d: string:@h=
URxvt.keysym.Mod4-0x3d: string:@s=
! custom C-=
URxvt.keysym.C-0x3d: string:@c=
URxvt.keysym.C-S-0x3d: string:[==
! custom C-S->
URxvt.keysym.C-S-0x3e: string:[=>
URxvt.keysym.Mod3-S-0x3e: string:[======>
URxvt.keysym.Mod4-S-0x3e: string:[=====>
URxvt.keysym.Mod3-S-0x3f: string:[======?
URxvt.keysym.Mod4-S-0x3f: string:[=====?
URxvt.keysym.Mod3-S-0x40: string:[======@
URxvt.keysym.Mod4-S-0x40: string:[=====@
URxvt.keysym.Mod3-S-0x41: string:[======A
URxvt.keysym.Mod4-S-0x41: string:[=====A
URxvt.keysym.C-S-0x41: string:[=A
URxvt.keysym.M-S-0x41: string:[===A
URxvt.keysym.C-M-S-0x41: string:[==A
URxvt.keysym.Mod3-S-0x42: string:[======B
URxvt.keysym.Mod4-S-0x42: string:[=====B
URxvt.keysym.C-S-0x42: string:[=B
URxvt.keysym.M-S-0x42: string:[===B
URxvt.keysym.C-M-S-0x42: string:[==B
URxvt.keysym.Mod3-S-0x43: string:[======C
URxvt.keysym.Mod4-S-0x43: string:[=====C
URxvt.keysym.C-S-0x43: string:[=C
URxvt.keysym.M-S-0x43: string:[===C
URxvt.keysym.C-M-S-0x43: string:[==C
URxvt.keysym.Mod3-S-0x44: string:[======D
URxvt.keysym.Mod4-S-0x44: string:[=====D
URxvt.keysym.C-S-0x44: string:[=D
URxvt.keysym.M-S-0x44: string:[===D
URxvt.keysym.C-M-S-0x44: string:[==D
URxvt.keysym.Mod3-S-0x45: string:[======E
URxvt.keysym.Mod4-S-0x45: string:[=====E
URxvt.keysym.C-S-0x45: string:[=E
URxvt.keysym.M-S-0x45: string:[===E
URxvt.keysym.C-M-S-0x45: string:[==E
URxvt.keysym.Mod3-S-0x46: string:[======F
URxvt.keysym.Mod4-S-0x46: string:[=====F
URxvt.keysym.C-S-0x46: string:[=F
URxvt.keysym.M-S-0x46: string:[===F
URxvt.keysym.C-M-S-0x46: string:[==F
URxvt.keysym.Mod3-S-0x47: string:[======G
URxvt.keysym.Mod4-S-0x47: string:[=====G
URxvt.keysym.C-S-0x47: string:[=G
URxvt.keysym.M-S-0x47: string:[===G
URxvt.keysym.C-M-S-0x47: string:[==G
URxvt.keysym.Mod3-S-0x48: string:[======H
URxvt.keysym.Mod4-S-0x48: string:[=====H
URxvt.keysym.C-S-0x48: string:[=H
URxvt.keysym.M-S-0x48: string:[===H
URxvt.keysym.C-M-S-0x48: string:[==H
URxvt.keysym.Mod3-S-0x49: string:[======I
URxvt.keysym.Mod4-S-0x49: string:[=====I
URxvt.keysym.C-S-0x49: string:[=I
URxvt.keysym.M-S-0x49: string:[===I
URxvt.keysym.C-M-S-0x49: string:[==I
URxvt.keysym.Mod3-S-0x4a: string:[======J
URxvt.keysym.Mod4-S-0x4a: string:[=====J
URxvt.keysym.C-S-0x4a: string:[=J
URxvt.keysym.M-S-0x4a: string:[===J
URxvt.keysym.C-M-S-0x4a: string:[==J
URxvt.keysym.Mod3-S-0x4b: string:[======K
URxvt.keysym.Mod4-S-0x4b: string:[=====K
URxvt.keysym.C-S-0x4b: string:[=K
URxvt.keysym.M-S-0x4b: string:[===K
URxvt.keysym.C-M-S-0x4b: string:[==K
URxvt.keysym.Mod3-S-0x4c: string:[======L
URxvt.keysym.Mod4-S-0x4c: string:[=====L
URxvt.keysym.C-S-0x4c: string:[=L
URxvt.keysym.M-S-0x4c: string:[===L
URxvt.keysym.C-M-S-0x4c: string:[==L
URxvt.keysym.Mod3-S-0x4d: string:[======M
URxvt.keysym.Mod4-S-0x4d: string:[=====M
URxvt.keysym.C-S-0x4d: string:[=M
URxvt.keysym.M-S-0x4d: string:[===M
URxvt.keysym.C-M-S-0x4d: string:[==M
URxvt.keysym.Mod3-S-0x4e: string:[======N
URxvt.keysym.Mod4-S-0x4e: string:[=====N
URxvt.keysym.C-S-0x4e: string:[=N
URxvt.keysym.M-S-0x4e: string:[===N
URxvt.keysym.C-M-S-0x4e: string:[==N
URxvt.keysym.Mod3-S-0x4f: string:[======O
URxvt.keysym.Mod4-S-0x4f: string:[=====O
URxvt.keysym.C-S-0x4f: string:[=O
URxvt.keysym.M-S-0x4f: string:[===O
URxvt.keysym.C-M-S-0x4f: string:[==O
URxvt.keysym.Mod3-S-0x50: string:[======P
URxvt.keysym.Mod4-S-0x50: string:[=====P
URxvt.keysym.C-S-0x50: string:[=P
URxvt.keysym.M-S-0x50: string:[===P
URxvt.keysym.C-M-S-0x50: string:[==P
URxvt.keysym.Mod3-S-0x51: string:[======Q
URxvt.keysym.Mod4-S-0x51: string:[=====Q
URxvt.keysym.C-S-0x51: string:[=Q
URxvt.keysym.M-S-0x51: string:[===Q
URxvt.keysym.C-M-S-0x51: string:[==Q
URxvt.keysym.Mod3-S-0x52: string:[======R
URxvt.keysym.Mod4-S-0x52: string:[=====R
URxvt.keysym.C-S-0x52: string:[=R
URxvt.keysym.M-S-0x52: string:[===R
URxvt.keysym.C-M-S-0x52: string:[==R
URxvt.keysym.Mod3-S-0x53: string:[======S
URxvt.keysym.Mod4-S-0x53: string:[=====S
URxvt.keysym.C-S-0x53: string:[=S
URxvt.keysym.M-S-0x53: string:[===S
URxvt.keysym.C-M-S-0x53: string:[==S
URxvt.keysym.Mod3-S-0x54: string:[======T
URxvt.keysym.Mod4-S-0x54: string:[=====T
URxvt.keysym.C-S-0x54: string:[=T
URxvt.keysym.M-S-0x54: string:[===T
URxvt.keysym.C-M-S-0x54: string:[==T
URxvt.keysym.Mod3-S-0x55: string:[======U
URxvt.keysym.Mod4-S-0x55: string:[=====U
URxvt.keysym.C-S-0x55: string:[=U
URxvt.keysym.M-S-0x55: string:[===U
URxvt.keysym.C-M-S-0x55: string:[==U
URxvt.keysym.Mod3-S-0x56: string:[======V
URxvt.keysym.Mod4-S-0x56: string:[=====V
URxvt.keysym.C-S-0x56: string:[=V
URxvt.keysym.M-S-0x56: string:[===V
URxvt.keysym.C-M-S-0x56: string:[==V
URxvt.keysym.Mod3-S-0x57: string:[======W
URxvt.keysym.Mod4-S-0x57: string:[=====W
URxvt.keysym.C-S-0x57: string:[=W
URxvt.keysym.M-S-0x57: string:[===W
URxvt.keysym.C-M-S-0x57: string:[==W
URxvt.keysym.Mod3-S-0x58: string:[======X
URxvt.keysym.Mod4-S-0x58: string:[=====X
URxvt.keysym.C-S-0x58: string:[=X
URxvt.keysym.M-S-0x58: string:[===X
URxvt.keysym.C-M-S-0x58: string:[==X
URxvt.keysym.Mod3-S-0x59: string:[======Y
URxvt.keysym.Mod4-S-0x59: string:[=====Y
URxvt.keysym.C-S-0x59: string:[=Y
URxvt.keysym.M-S-0x59: string:[===Y
URxvt.keysym.C-M-S-0x59: string:[==Y
URxvt.keysym.Mod3-S-0x5a: string:[======Z
URxvt.keysym.Mod4-S-0x5a: string:[=====Z
URxvt.keysym.C-S-0x5a: string:[=Z
URxvt.keysym.M-S-0x5a: string:[===Z
URxvt.keysym.C-M-S-0x5a: string:[==Z
URxvt.keysym.Mod3-0x5b: string:@h[
URxvt.keysym.Mod4-0x5b: string:@s[
URxvt.keysym.Mod3-0x5c: string:@h\
URxvt.keysym.Mod4-0x5c: string:@s\
URxvt.keysym.Mod3-0x5d: string:@h]
URxvt.keysym.Mod4-0x5d: string:@s]
URxvt.keysym.Mod3-S-0x5e: string:[======^
URxvt.keysym.Mod4-S-0x5e: string:[=====^
URxvt.keysym.Mod3-S-0x5f: string:[======_
URxvt.keysym.Mod4-S-0x5f: string:[=====_
URxvt.keysym.Mod3-0x60: string:@h`
URxvt.keysym.Mod4-0x60: string:@s`
URxvt.keysym.Mod3-0x61: string:@ha
URxvt.keysym.Mod4-0x61: string:@sa
URxvt.keysym.Mod3-0x62: string:@hb
URxvt.keysym.Mod4-0x62: string:@sb
URxvt.keysym.Mod3-0x63: string:@hc
URxvt.keysym.Mod4-0x63: string:@sc
URxvt.keysym.Mod3-0x64: string:@hd
URxvt.keysym.Mod4-0x64: string:@sd
URxvt.keysym.Mod3-0x65: string:@he
URxvt.keysym.Mod4-0x65: string:@se
URxvt.keysym.Mod3-0x66: string:@hf
URxvt.keysym.Mod4-0x66: string:@sf
URxvt.keysym.Mod3-0x67: string:@hg
URxvt.keysym.Mod4-0x67: string:@sg
URxvt.keysym.Mod3-0x68: string:@hh
URxvt.keysym.Mod4-0x68: string:@sh
URxvt.keysym.Mod3-0x69: string:@hi
URxvt.keysym.Mod4-0x69: string:@si
URxvt.keysym.Mod3-0x6a: string:@hj
URxvt.keysym.Mod4-0x6a: string:@sj
URxvt.keysym.Mod3-0x6b: string:@hk
URxvt.keysym.Mod4-0x6b: string:@sk
URxvt.keysym.Mod3-0x6c: string:@hl
URxvt.keysym.Mod4-0x6c: string:@sl
URxvt.keysym.Mod3-0x6d: string:@hm
URxvt.keysym.Mod4-0x6d: string:@sm
URxvt.keysym.Mod3-0x6e: string:@hn
URxvt.keysym.Mod4-0x6e: string:@sn
URxvt.keysym.Mod3-0x6f: string:@ho
URxvt.keysym.Mod4-0x6f: string:@so
URxvt.keysym.Mod3-0x70: string:@hp
URxvt.keysym.Mod4-0x70: string:@sp
URxvt.keysym.Mod3-0x71: string:@hq
URxvt.keysym.Mod4-0x71: string:@sq
URxvt.keysym.Mod3-0x72: string:@hr
URxvt.keysym.Mod4-0x72: string:@sr
URxvt.keysym.Mod3-0x73: string:@hs
URxvt.keysym.Mod4-0x73: string:@ss
URxvt.keysym.Mod3-0x74: string:@ht
URxvt.keysym.Mod4-0x74: string:@st
URxvt.keysym.Mod3-0x75: string:@hu
URxvt.keysym.Mod4-0x75: string:@su
URxvt.keysym.Mod3-0x76: string:@hv
URxvt.keysym.Mod4-0x76: string:@sv
URxvt.keysym.Mod3-0x77: string:@hw
URxvt.keysym.Mod4-0x77: string:@sw
URxvt.keysym.Mod3-0x78: string:@hx
URxvt.keysym.Mod4-0x78: string:@sx
URxvt.keysym.Mod3-0x79: string:@hy
URxvt.keysym.Mod4-0x79: string:@sy
URxvt.keysym.Mod3-0x7a: string:@hz
URxvt.keysym.Mod4-0x7a: string:@sz
URxvt.keysym.Mod3-S-0x7b: string:[======{
URxvt.keysym.Mod4-S-0x7b: string:[====={
URxvt.keysym.Mod3-S-0x7c: string:[======|
URxvt.keysym.Mod4-S-0x7c: string:[=====|
URxvt.keysym.Mod3-S-0x7d: string:[======}
URxvt.keysym.Mod4-S-0x7d: string:[=====}
URxvt.keysym.Mod3-S-0x7e: string:[======~
URxvt.keysym.Mod4-S-0x7e: string:[=====~
URxvt.keysym.C-M-0x67: string:[====g
! URxvt.keysym.C-M-0x20: string:[==== 
! URxvt.keysym.Shift-0x20: string:@S 
URxvt.keysym.C-M-Return: [====
URxvt.keysym.C-Return: string:@c
URxvt.keysym.Shift-Return: string:@S

~/.Xdefaults configuration file

  1. xterm-keybinder – GitHub ↩︎