fed1b28adc242ccc74c7db8d9863be77130dc0d4
[dana/urxvt.git] / doc / rxvt.7.txt
1 NAME
2     RXVT REFERENCE - FAQ, command sequences and other background information
3
4 FREQUENTLY ASKED QUESTIONS
5     How do I know which rxvt-unicode version I'm using?
6         The version number is displayed with the usage (-h). Also the escape
7         sequence "ESC[8n" sets the window title to the version number.
8
9     When I log-in to another system it tells me about missing terminfo data?
10         The terminal description used by rxvt-unicode is not as widely
11         available as that for xterm, or even rxvt (for which the same
12         problem often arises).
13
14         The correct solution for this problem is to install the terminfo,
15         this can be done like this (with ncurses' infocmp):
16
17            REMOTE=remotesystem.domain
18            infocmp rxvt-unicode | ssh $REMOTE "cat >/tmp/ti && tic /tmp/ti"
19
20         ... or by installing rxvt-unicode normally on the remote system,
21
22         If you cannot or do not want to do this, then you can simply set
23         "TERM=rxvt" or even "TERM=xterm", and live with the small number of
24         problems arising, which includes wrong keymapping, less and
25         different colours and some refresh errors in fullscreen
26         applications. It's a nice quick-and-dirty workaround for rare cases,
27         though.
28
29         If you always want to do this you can either recompile rxvt-unicode
30         with the desired TERM value or use a resource to set it:
31
32            URxvt.termName: rxvt
33
34         If you don't plan to use rxvt (quite common...) you could also
35         replace the rxvt terminfo file with the rxvt-unicode one.
36
37     I need a termcap file entry.
38         You could use rxvt's termcap entry with resonable results in many
39         cases. You can also create a termcap entry by using terminfo's
40         infocmp program like this:
41
42            infocmp -C rxvt-unicode
43
44         OR you could this termcap entry:
45
46            rxvt-unicode|rxvt-unicode terminal (X Window System):\
47                    :am:bw:eo:km:mi:ms:xn:xo:\
48                    :co#80:it#8:li#24:\
49                    :AL=\E[%dL:DC=\E[%dP:DL=\E[%dM:DO=\E[%dB:IC=\E[%d@:\
50                    :K1=\EOw:K2=\EOu:K3=\EOy:K4=\EOq:K5=\EOs:LE=\E[%dD:\
51                    :RI=\E[%dC:SF=\E[%dS:SR=\E[%dT:UP=\E[%dA:ae=^O:al=\E[L:\
52                    :as=^N:bl=^G:cd=\E[J:ce=\E[K:cl=\E[H\E[2J:cm=\E[%i%d;%dH:\
53                    :cr=^M:cs=\E[%i%d;%dr:ct=\E[3g:dc=\E[P:dl=\E[M:do=^J:\
54                    :ec=\E[%dX:ei=\E[4l:ho=\E[H:i1=\E[?47l\E=\E[?1l:ic=\E[@:\
55                    :im=\E[4h:is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l\E[4l:\
56                    :k0=\E[21~:k1=\E[11~:k2=\E[12~:k3=\E[13~:k4=\E[14~:\
57                    :k5=\E[15~:k6=\E[17~:k7=\E[18~:k8=\E[19~:k9=\E[20~:\
58                    :kD=\E[3~:kI=\E[2~:kN=\E[6~:kP=\E[5~:kb=\177:kd=\EOB:\
59                    :ke=\E[?1l\E>:kh=\E[7~:kl=\EOD:kr=\EOC:ks=\E[?1h\E=:\
60                    :ku=\EOA:le=^H:mb=\E[5m:md=\E[1m:me=\E[m\017:mr=\E[7m:\
61                    :nd=\E[C:rc=\E8:sc=\E7:se=\E[27m:sf=^J:so=\E[7m:sr=\EM:\
62                    :st=\EH:ta=^I:te=\E[r\E[?1049l:ti=\E[?1049h:ue=\E[24m:\
63                    :up=\E[A:us=\E[4m:vb=\E[?5h\E[?5l:ve=\E[?25h:vi=\E[?25l:\
64                    :vs=\E[?25h:
65
66     Why does "ls" no longer have coloured output?
67         The "ls" in the GNU coreutils unfortunately doesn't use terminfo to
68         decide wether a terminal has colour, but uses it's own configuration
69         file. Needless to say, "rxvt-unicode" is not in it's default file
70         (among with most other terminals supporting colour). Either add:
71
72            TERM rxvt-unicode
73
74         to "/etc/DIR_COLORS" or simply add:
75
76            alias ls='ls --color=auto'
77
78         to your ".profile" or ".bashrc".
79
80     Why doesn't vim/emacs etc. use the 88 colour mode?
81     Why doesn't vim/emacs etc. make use of italic?
82     Why are the secondary screen-related options not working properly?
83         Make sure you are using "TERM=rxvt-unicode". Some pre-packaged
84         distributions (most notably Debian GNU/Linux) break rxvt-unicode by
85         setting "TERM" to "rxvt", which doesn't have these extra features.
86         Unfortunately, some of these (most notably, again, Debian GNU/Linux)
87         furthermore fail to even install the "rxvt-unicode" terminfo file,
88         so you will need to install it on your own (See the question When I
89         log-in to another system it tells me about missing terminfo data? on
90         how to do this).
91
92     Rxvt-unicode does not seem to understand the selected encoding?
93     Unicode does not seem to work?
94         If you encounter strange problems like typing an accented character
95         but getting two unrelated other characters or similar, or if program
96         output is subtly garbled, then you should check your locale
97         settings.
98
99         Rxvt-unicode must be started with the same "LC_CTYPE" setting as the
100         programs. Often rxvt-unicode is started in the "C" locale, while the
101         login script running within the rxvt-unicode window changes the
102         locale to sth. else, e.h. "en_GB.UTF-8". Needless to say, this is
103         not going to work.
104
105         The best thing is to fix your startup environment, as you will
106         likely run into other problems. If nothing works you can try this in
107         your .profile.
108
109           printf '\e]701;%s\007' "$LC_CTYPE"
110
111         If this doesn't work, then maybe you use a "LC_CTYPE" specification
112         not supported on your systems. Some systems have a "locale" command
113         which displays this. If it displays sth. like:
114
115           locale: Cannot set LC_CTYPE to default locale: ...
116
117         Then the locale you specified is not supported on your system.
118
119         If nothing works and you are sure that everything is set correctly
120         then you will need to remember a little known fact: Some programs
121         just don't support locales :(
122
123     Why do some characters look so much different than others?
124     How does rxvt-unicode choose fonts?
125         Most fonts do not contain the full range of Unicode, which is fine.
126         Chances are that the font you (or the admin/package maintainer of
127         your system/os) have specified does not cover all the characters you
128         want to display.
129
130         rxvt-unicode makes a best-effort try at finding a replacement font.
131         Often the result is fine, but sometimes the chosen font looks bad.
132         Many fonts have totally strange characters that don't resemble the
133         correct glyph at all, and rxvt-unicode lacks the artificial
134         intelligence to detect that a specific glyph is wrong: it has to
135         believe the font that the characters it contains indeed look
136         correct.
137
138         In that case, select a font of your taste and add it to the font
139         list, e.g.:
140
141            rxvt -fn basefont,font2,font3...
142
143         When rxvt-unicode sees a character, it will first look at the base
144         font. If the base font does not contain the character, it will go to
145         the next font, and so on. Specifying your own fonts will also speed
146         up this search and use less resources within rxvt-unicode and the
147         X-server.
148
149         The only limitation is that all the fonts must not be larger than
150         the base font, as the base font defines the principal cell size,
151         which must be the same due to the way terminals work.
152
153     Why do some chinese characters look so different than others?
154         This is because there is a difference between script and language --
155         rxvt-unicode does not know which language the text that is output
156         is, as it only knows the unicode character codes. If rxvt-unicode
157         first sees a japanese character, it might choose a japanese font for
158         it. Subsequent japanese characters will take that font. Now, many
159         chinese characters aren't represented in japanese fonts, so when the
160         first non-japanese character comes up, rxvt-unicode will look for a
161         chinese font -- unfortunately at this point, it will still use the
162         japanese font for japanese characters that are also chinese.
163
164         The workaround is easy: just tag a chinese font at the end of your
165         font list (see the previous question). The key is to view the font
166         list as a preference list: If you expect more japanese, list a
167         japanese font first. If you expect more chinese, put a chinese font
168         first.
169
170         In the future it might be possible to switch preferences at runtime
171         (the internal data structure has no problem with using different
172         fonts for the same character at the same time, but no interface for
173         this has been designed yet).
174
175     Why does rxvt-unicode sometimes leave pixel droppings?
176         Most fonts were not designed for terminal use, which means that
177         character size varies a lot. A font that is otherwise fine for
178         terminal use might contain some characters that are simply too wide.
179         Rxvt-unicode will avoid these characters. For characters that are
180         just "a bit" too wide a special "careful" rendering mode is used
181         that redraws adjacent characters.
182
183         All of this requires that fonts do not lie about character sizes,
184         however: Xft fonts often draw glyphs larger than their acclaimed
185         bounding box, and rxvt-unicode has no way of detecting this (the
186         correct way is to ask for the character bounding box, which
187         unfortunately is wrong in these cases).
188
189         It's not clear (to me at least), wether this is a bug in Xft,
190         freetype, or the respective font. If you encounter this problem you
191         might try using the "-lsp" option to give the font more height. If
192         that doesn't work, you might be forced to use a different font.
193
194         All of this is not a problem when using X11 core fonts, as their
195         bounding box data is correct.
196
197     My Compose (Multi_key) key is no longer working.
198         The most common causes for this are that either your locale is not
199         set correctly, or you specified a preeditStyle that is not supported
200         by your input method. For example, if you specified OverTheSpot and
201         your input method (e.g. the default input method handling Compose
202         keys) does not support this (for instance because it is not visual),
203         then rxvt-unicode will continue without an input method.
204
205         In this case either do not specify a preeditStyle or specify more
206         than one pre-edit style, such as OverTheSpot,Root,None.
207
208     I cannot type "Ctrl-Shift-2" to get an ASCII NUL character due to ISO
209     14755
210         Either try "Ctrl-2" alone (it often is mapped to ASCII NUL even on
211         international keyboards) or simply use ISO 14755 support to your
212         advantage, typing <Ctrl-Shift-0> to get a ASCII NUL. This works for
213         other codes, too, such as "Ctrl-Shift-1-d" to type the default
214         telnet escape character and so on.
215
216     How can I keep rxvt-unicode from using reverse video so much?
217         First of all, make sure you are running with the right terminfo
218         ("urxvt"), which will get rid of most of these effects. Then make
219         sure you have specified colours for italic and bold, as otherwise
220         rxvt-unicode might use reverse video to simulate the effect:
221
222            URxvt*colorBD:  white
223            URxvt*colorIT:  green
224
225     Some programs assume totally weird colours (red instead of blue), how
226     can I fix that?
227         For some unexplainable reason, some programs (i.e. irssi) assume a
228         very weird colour palette when confronted with a terminal with more
229         than the standard 8 colours (rxvt-unicode supports 88). The right
230         fix is, of course, to fix these programs not to assume non-ISO
231         colours without very good reasons.
232
233         In the meantime, you can either edit your "urxvt" terminfo
234         definition to only claim 8 colour support or use "TERM=rxvt", which
235         will fix colours but keep you from using other rxvt-unicode
236         features.
237
238     I am on FreeBSD and rxvt-unicode does not seem to work at all.
239         Rxvt-unicode requires the symbol "__STDC_ISO_10646__" to be defined
240         in your compile environment, or an implementation that implements
241         it, wether it defines the symbol or not. "__STDC_ISO_10646__"
242         requires that wchar_t is represented as unicode.
243
244         As you might have guessed, FreeBSD does neither define this symobl
245         nor does it support it. Instead, it uses it's own internal
246         representation of wchar_t. This is, of course, completely legal.
247
248         However, "__STDC_ISO_10646__" is the only sane way to support
249         multi-language apps in an OS, as using a locale-dependent (and
250         non-standardized) representation of wchar_t makes it impossible to
251         convert between wchar_t (as used by X11 and your applications) and
252         any other encoding without implementing OS-specific-wrappers for
253         each and every locale. There simply are no APIs to convert wchar_t
254         into anything except the current locale encoding.
255
256         Some applications (such as the formidable mlterm) work around this
257         by carrying their own replacement functions for character set
258         handling with them, and either implementing OS-dependent hacks or
259         doing multiple conversions (which is slow and unreliable in case the
260         OS implements encodings slightly different than the terminal
261         emulator).
262
263         The rxvt-unicode author insists that the right way to fix this is in
264         the system libraries once and for all, instead of forcing every app
265         to carry complete replacements.
266
267     How does rxvt-unicode determine the encoding to use?
268     Is there an option to switch encodings?
269         Unlike some other terminals, rxvt-unicode has no encoding switch,
270         and no specific "utf-8" mode, such as xterm. In fact, it doesn't
271         even know about UTF-8 or any other encodings with respect to
272         terminal I/O.
273
274         The reasons is that there exists a perfectly fine mechanism for
275         selecting the encoding, doing I/O and (most important) communicating
276         this to all applications so everybody agrees on character properties
277         such as width and code number. This mechanism is the *locale*.
278
279         Rxvt-unicode uses the "LC_CTYPE" locale category to select encoding.
280         All programs doing the same (that is, most) will automatically agree
281         in the interpretation of characters.
282
283         Unfortunately, there is no system-independent way to select locales,
284         nor is there a standard on how locale specifiers will look like.
285
286         On most systems, the content of the "LC_CTYPE" environment variable
287         contains an arbitrary string which corresponds to an
288         already-installed locale. Common names for locales are
289         "en_US.UTF-8", "de_DE.ISO-8859-15", "ja_JP.EUC-JP", i.e.
290         "language_country.encoding", but other forms (i.e. "de" or "german")
291         are also common.
292
293         Rxvt-unicode ignores all other locale categories, and except for the
294         encoding, ignores country or language-specific settings, i.e.
295         "de_DE.UTF-8" and "ja_JP.UTF-8" are the same for rxvt-unicode.
296
297         If you want to use a specific encoding you have to make sure you
298         start rxvt-unicode with the correct "LC_CTYPE" category.
299
300     Can I switch locales at runtime?
301         Yes, using an escape sequence. Try sth. like this, which sets
302         rxvt-unicode's idea of "LC_CTYPE".
303
304           printf '\e]701;%s\007' ja_JP.SJIS
305
306         See also the previous question.
307
308         Sometimes this capability is rather handy when you want to work in
309         one locale (e.g. "de_DE.UTF-8") but some programs don't support
310         UTF-8. For example, I use this script to start "xjdic", which first
311         switches to a locale supported by xjdic and back later:
312
313            printf '\e]701;%s\007' ja_JP.SJIS
314            xjdic -js
315            printf '\e]701;%s\007' de_DE.UTF-8
316
317     Can I switch the fonts at runtime?
318         Yes, using an escape sequence. Try sth. like this, which has the
319         same effect as using the "-fn" switch, and takes effect immediately:
320
321            printf '\e]50;%s\007' "9x15bold,xft:Kochi Gothic"
322
323         This is useful if you e.g. work primarily with japanese (and prefer
324         a japanese font), but you have to switch to chinese temporarily,
325         where japanese fonts would only be in your way.
326
327         You can think of this as a kind of manual ISO-2022 switching.
328
329     Why do italic characters look as if clipped?
330         Many fonts have difficulties with italic characters and hinting. For
331         example, the otherwise very nicely hinted font "xft:Bitstream Vera
332         Sans Mono" completely fails in it's italic face. A workaround is to
333         enable freetype autohinting, i.e. like this:
334
335            URxvt*italicFont:        xft:Bitstream Vera Sans Mono:italic:autohint=true
336            URxvt*boldItalicFont:    xft:Bitstream Vera Sans Mono:bold:italic:autohint=true
337
338     My input method wants <some encoding> but I want UTF-8, what can I do?
339         You can specify separate locales for the input method and the rest
340         of the terminal, using the resource "imlocale":
341
342            URxvt*imlocale: ja_JP.EUC-JP
343
344         Now you can start your terminal with "LC_CTYPE=ja_JP.UTF-8" and
345         still use your input method. Please note, however, that you will not
346         be able to input characters outside "EUC-JP" in a normal way then,
347         as your input method limits you.
348
349     Rxvt-unicode uses gobs of memory, how can I reduce that?
350         Rxvt-unicode tries to obey the rule of not charging you for sth. you
351         don't use. One thing you should try is to configure out all settings
352         that you don't need, for example, Xft support is a resource hog by
353         design, when used. Compiling it out ensures that no Xft font will be
354         loaded accidentally when rxvt-unicode tries to find a font for your
355         characters.
356
357         Also, many people (me included) like large windows and even larger
358         scrollback buffers: Without "--enable-unicode3", rxvt-unicode will
359         use 6 bytes per screen cell. For a 160x?? window this amounts to
360         almost a kilobyte per line. A scrollback buffer of 10000 lines will
361         then (if full) use 10 Megabytes of memory. With "--enable-unicode3"
362         it gets worse, as rxvt-unicode then uses 8 bytes per screen cell.
363
364     Can I speed up Xft rendering somehow?
365         Yes, the most obvious way to speed it up is to avoid Xft entirely,
366         as it is simply slow. If you still want Xft fonts you might try to
367         disable antialiasing (by appending ":antialiasing=false"), which
368         saves lots of memory and also speeds up rendering considerably.
369
370     Rxvt-unicode doesn't seem to anti-alias its fonts, what is wrong?
371         Rxvt-unicode will use whatever you specify as a font. If it needs to
372         fall back to it's default font search list it will prefer X11 core
373         fonts, because they are small and fast, and then use Xft fonts. It
374         has antialiasing disabled for most of them, because the author
375         thinks they look best that way.
376
377         If you want antialiasing, you have to specify the fonts manually.
378
379     Mouse cut/paste suddenly no longer works.
380         Make sure that mouse reporting is actually turned off since killing
381         some editors prematurely may leave the mouse in mouse report mode.
382         I've heard that tcsh may use mouse reporting unless it otherwise
383         specified. A quick check is to see if cut/paste works when the Alt
384         or Shift keys are depressed. See rxvt(7)
385
386     What's with this bold/blink stuff?
387         If no bold colour is set via "colorBD:", bold will invert text using
388         the standard foreground colour.
389
390         For the standard background colour, blinking will actually make the
391         text blink when compiled with "--enable-blinking". with standard
392         colours. Without "--enable-blinking", the blink attribute will be
393         ignored.
394
395         On ANSI colours, bold/blink attributes are used to set
396         high-intensity foreground/background colors.
397
398         color0-7 are the low-intensity colors.
399
400         color8-15 are the corresponding high-intensity colors.
401
402     I don't like the screen colors. How do I change them?
403         You can change the screen colors at run-time using ~/.Xdefaults
404         resources (or as long-options).
405
406         Here are values that are supposed to resemble a VGA screen,
407         including the murky brown that passes for low-intensity yellow:
408
409            URxvt*color0:   #000000
410            URxvt*color1:   #A80000
411            URxvt*color2:   #00A800
412            URxvt*color3:   #A8A800
413            URxvt*color4:   #0000A8
414            URxvt*color5:   #A800A8
415            URxvt*color6:   #00A8A8
416            URxvt*color7:   #A8A8A8
417
418            URxvt*color8:   #000054
419            URxvt*color9:   #FF0054
420            URxvt*color10:  #00FF54
421            URxvt*color11:  #FFFF54
422            URxvt*color12:  #0000FF
423            URxvt*color13:  #FF00FF
424            URxvt*color14:  #00FFFF
425            URxvt*color15:  #FFFFFF
426
427         And here is a more complete set of non-standard colors described as
428         "pretty girly":
429
430            URxvt.cursorColor:  #dc74d1
431            URxvt.pointerColor: #dc74d1
432            URxvt.background:   #0e0e0e
433            URxvt.foreground:   #4ad5e1
434            URxvt.color0:       #000000
435            URxvt.color8:       #8b8f93
436            URxvt.color1:       #dc74d1
437            URxvt.color9:       #dc74d1
438            URxvt.color2:       #0eb8c7
439            URxvt.color10:      #0eb8c7
440            URxvt.color3:       #dfe37e
441            URxvt.color11:      #dfe37e
442            URxvt.color5:       #9e88f0
443            URxvt.color13:      #9e88f0
444            URxvt.color6:       #73f7ff
445            URxvt.color14:      #73f7ff
446            URxvt.color7:       #e1dddd
447            URxvt.color15:      #e1dddd
448
449     What's with the strange Backspace/Delete key behaviour?
450         Assuming that the physical Backspace key corresponds to the
451         BackSpace keysym (not likely for Linux ... see the following
452         question) there are two standard values that can be used for
453         Backspace: "^H" and "^?".
454
455         Historically, either value is correct, but rxvt-unicode adopts the
456         debian policy of using "^?" when unsure, because it's the one only
457         only correct choice :).
458
459         Rxvt-unicode tries to inherit the current stty settings and uses the
460         value of `erase' to guess the value for backspace. If rxvt-unicode
461         wasn't started from a terminal (say, from a menu or by remote
462         shell), then the system value of `erase', which corresponds to
463         CERASE in <termios.h>, will be used (which may not be the same as
464         your stty setting).
465
466         For starting a new rxvt-unicode:
467
468            # use Backspace = ^H
469            $ stty erase ^H
470            $ rxvt
471
472            # use Backspace = ^?
473            $ stty erase ^?
474            $ rxvt
475
476         Toggle with "ESC[36h" / "ESC[36l" as documented in rxvt(7).
477
478         For an existing rxvt-unicode:
479
480            # use Backspace = ^H
481            $ stty erase ^H
482            $ echo -n "^[[36h"
483
484            # use Backspace = ^?
485            $ stty erase ^?
486            $ echo -n "^[[36l"
487
488         This helps satisfy some of the Backspace discrepancies that occur,
489         but if you use Backspace = "^H", make sure that the termcap/terminfo
490         value properly reflects that.
491
492         The Delete key is a another casualty of the ill-defined Backspace
493         problem. To avoid confusion between the Backspace and Delete keys,
494         the Delete key has been assigned an escape sequence to match the
495         vt100 for Execute (ESC[3~) and is in the supplied termcap/terminfo.
496
497         Some other Backspace problems:
498
499         some editors use termcap/terminfo, some editors (vim I'm told)
500         expect Backspace = ^H, GNU Emacs (and Emacs-like editors) use ^H for
501         help.
502
503         Perhaps someday this will all be resolved in a consistent manner.
504
505     I don't like the key-bindings. How do I change them?
506         There are some compile-time selections available via configure.
507         Unless you have run "configure" with the "--disable-resources"
508         option you can use the `keysym' resource to alter the keystrings
509         associated with keysyms.
510
511         Here's an example for a URxvt session started using `rxvt -name
512         URxvt'
513
514            URxvt.keysym.Home:          \e[1~
515            URxvt.keysym.End:           \e[4~
516            URxvt.keysym.C-apostrophe:  \e<C-'>
517            URxvt.keysym.C-slash:       \e<C-/>
518            URxvt.keysym.C-semicolon:   \e<C-;>
519            URxvt.keysym.C-grave:       \e<C-`>
520            URxvt.keysym.C-comma:       \e<C-,>
521            URxvt.keysym.C-period:      \e<C-.>
522            URxvt.keysym.C-0x60:        \e<C-`>
523            URxvt.keysym.C-Tab:         \e<C-Tab>
524            URxvt.keysym.C-Return:      \e<C-Return>
525            URxvt.keysym.S-Return:      \e<S-Return>
526            URxvt.keysym.S-space:       \e<S-Space>
527            URxvt.keysym.M-Up:          \e<M-Up>
528            URxvt.keysym.M-Down:        \e<M-Down>
529            URxvt.keysym.M-Left:        \e<M-Left>
530            URxvt.keysym.M-Right:       \e<M-Right>
531            URxvt.keysym.M-C-0:         list \e<M-C- 0123456789 >
532            URxvt.keysym.M-C-a:         list \033<M-C- abcdefghijklmnopqrstuvwxyz >
533            URxvt.keysym.F12:           proto:\033]701;zh_CN.GBK\007
534
535         See some more examples in the documentation for the keysym resource.
536
537     I'm using keyboard model XXX that has extra Prior/Next/Insert keys. How
538     do I make use of them? For example, the Sun Keyboard type 4 has the
539     following mappings that rxvt-unicode doesn't recognize.
540            KP_Insert == Insert
541            F22 == Print
542            F27 == Home
543            F29 == Prior
544            F33 == End
545            F35 == Next
546
547         Rather than have rxvt-unicode try to accommodate all the various
548         possible keyboard mappings, it is better to use `xmodmap' to remap
549         the keys as required for your particular machine.
550
551     How do I distinguish if I'm running rxvt-unicode or a regular xterm? I
552     need this to decide about setting colors etc.
553         rxvt and rxvt-unicode always export the variable "COLORTERM", so you
554         can check and see if that is set. Note that several programs, JED,
555         slrn, Midnight Commander automatically check this variable to decide
556         whether or not to use color.
557
558     How do I set the correct, full IP address for the DISPLAY variable?
559         If you've compiled rxvt-unicode with DISPLAY_IS_IP and have enabled
560         insecure mode then it is possible to use the following shell script
561         snippets to correctly set the display. If your version of
562         rxvt-unicode wasn't also compiled with ESCZ_ANSWER (as assumed in
563         these snippets) then the COLORTERM variable can be used to
564         distinguish rxvt-unicode from a regular xterm.
565
566         Courtesy of Chuck Blake <cblake@BBN.COM> with the following shell
567         script snippets:
568
569            # Bourne/Korn/POSIX family of shells:
570            [ ${TERM:-foo} = foo ] && TERM=xterm # assume an xterm if we don't know
571            if [ ${TERM:-foo} = xterm ]; then
572               stty -icanon -echo min 0 time 15 # see if enhanced rxvt or not
573               echo -n '^[Z'
574               read term_id
575               stty icanon echo
576               if [ ""${term_id} = '^[[?1;2C' -a ${DISPLAY:-foo} = foo ]; then
577                  echo -n '^[[7n'        # query the rxvt we are in for the DISPLAY string
578                  read DISPLAY           # set it in our local shell
579               fi
580            fi
581
582     How do I compile the manual pages for myself?
583         You need to have a recent version of perl installed as
584         /usr/bin/perl, one that comes with pod2man, pod2text and pod2html.
585         Then go to the doc subdirectory and enter "make alldoc".
586
587     My question isn't answered here, can I ask a human?
588         Before sending me mail, you could go to IRC: "irc.freenode.net",
589         channel "#rxvt-unicode" has some rxvt-unicode enthusiasts that might
590         be interested in learning about new and exciting problems (but not
591         FAQs :).
592
593 SYNOPSIS
594        # set a new font set
595        printf '\33]50;%s\007' 9x15,xft:Kochi" Mincho"
596
597        # change the locale and tell rxvt-unicode about it
598        export LC_CTYPE=ja_JP.EUC-JP; printf "\33]701;$LC_CTYPE\007"
599
600        # set window title
601        printf '\33]2;%s\007' "new window title"
602
603 DESCRIPTION
604     The rest of this document describes various technical aspects of
605     rxvt-unicode. First the description of supported command sequences,
606     followed by menu and pixmap support and last by a description of all
607     features selectable at "configure" time.
608
609 RXVT TECHNICAL REFERENCE
610 Definitions
611     "c" The literal character c.
612
613     "C" A single (required) character.
614
615     "Ps"
616         A single (usually optional) numeric parameter, composed of one or
617         more digits.
618
619     "Pm"
620         A multiple numeric parameter composed of any number of single
621         numeric parameters, separated by ";" character(s).
622
623     "Pt"
624         A text parameter composed of printable characters.
625
626 Values
627     "ENQ"
628         Enquiry (Ctrl-E) = Send Device Attributes (DA) request attributes
629         from terminal. See "ESC [ Ps c".
630
631     "BEL"
632         Bell (Ctrl-G)
633
634     "BS"
635         Backspace (Ctrl-H)
636
637     "TAB"
638         Horizontal Tab (HT) (Ctrl-I)
639
640     "LF"
641         Line Feed or New Line (NL) (Ctrl-J)
642
643     "VT"
644         Vertical Tab (Ctrl-K) same as "LF"
645
646     "FF"
647         Form Feed or New Page (NP) (Ctrl-L) same as "LF"
648
649     "CR"
650         Carriage Return (Ctrl-M)
651
652     "SO"
653         Shift Out (Ctrl-N), invokes the G1 character set. Switch to
654         Alternate Character Set
655
656     "SI"
657         Shift In (Ctrl-O), invokes the G0 character set (the default).
658         Switch to Standard Character Set
659
660     "SPC"
661         Space Character
662
663 Escape Sequences
664     "ESC # 8"
665         DEC Screen Alignment Test (DECALN)
666
667     "ESC 7"
668         Save Cursor (SC)
669
670     "ESC 8"
671         Restore Cursor
672
673     "ESC ="
674         Application Keypad (SMKX). See also next sequence.
675
676     "ESC"
677         Normal Keypad (RMKX)
678
679         Note: If the numeric keypad is activated, eg, Num_Lock has been
680         pressed, numbers or control functions are generated by the numeric
681         keypad (see Key Codes).
682
683     "ESC D"
684         Index (IND)
685
686     "ESC E"
687         Next Line (NEL)
688
689     "ESC H"
690         Tab Set (HTS)
691
692     "ESC M"
693         Reverse Index (RI)
694
695     "ESC N"
696         Single Shift Select of G2 Character Set (SS2): affects next
697         character only *unimplemented*
698
699     "ESC O"
700         Single Shift Select of G3 Character Set (SS3): affects next
701         character only *unimplemented*
702
703     "ESC Z"
704         Obsolete form of returns: "ESC[?1;2C" *rxvt-unicode compile-time
705         option*
706
707     "ESC c"
708         Full reset (RIS)
709
710     "ESC n"
711         Invoke the G2 Character Set (LS2)
712
713     "ESC o"
714         Invoke the G3 Character Set (LS3)
715
716     "ESC" ( C>
717         Designate G0 Character Set (ISO 2022), see below for values of "C".
718
719     "ESC" ) C>
720         Designate G1 Character Set (ISO 2022), see below for values of "C".
721
722     "ESC * C"
723         Designate G2 Character Set (ISO 2022), see below for values of "C".
724
725     "ESC + C"
726         Designate G3 Character Set (ISO 2022), see below for values of "C".
727
728     "ESC $ C"
729         Designate Kanji Character Set
730
731         Where "C" is one of:
732
733            C = 0           DEC Special Character and Line Drawing Set 
734            C = A           United Kingdom (UK) 
735            C = B           United States (USASCII) 
736            C = <           Multinational character set unimplemented 
737            C = 5           Finnish character set unimplemented 
738            C = C           Finnish character set unimplemented 
739            C = K           German character set unimplemented 
740
741
742
743 CSI (Command Sequence Introducer) Sequences
744     "ESC [ Ps @"
745         Insert "Ps" (Blank) Character(s) [default: 1] (ICH)
746
747     "ESC [ Ps A"
748         Cursor Up "Ps" Times [default: 1] (CUU)
749
750     "ESC [ Ps B"
751         Cursor Down "Ps" Times [default: 1] (CUD)
752
753     "ESC [ Ps C"
754         Cursor Forward "Ps" Times [default: 1] (CUF)
755
756     "ESC [ Ps D"
757         Cursor Backward "Ps" Times [default: 1] (CUB)
758
759     "ESC [ Ps E"
760         Cursor Down "Ps" Times [default: 1] and to first column
761
762     "ESC [ Ps F"
763         Cursor Up "Ps" Times [default: 1] and to first column
764
765     "ESC [ Ps G"
766         Cursor to Column "Ps" (HPA)
767
768     "ESC [ Ps;Ps H"
769         Cursor Position [row;column] [default: 1;1] (CUP)
770
771     "ESC [ Ps I"
772         Move forward "Ps" tab stops [default: 1]
773
774     "ESC [ Ps J"
775         Erase in Display (ED)
776
777            Ps = 0          Clear Below (default) 
778            Ps = 1          Clear Above     
779            Ps = 2          Clear All       
780
781     "ESC [ Ps K"
782         Erase in Line (EL)
783
784            Ps = 0          Clear to Right (default) 
785            Ps = 1          Clear to Left   
786            Ps = 2          Clear All       
787
788     "ESC [ Ps L"
789         Insert "Ps" Line(s) [default: 1] (IL)
790
791     "ESC [ Ps M"
792         Delete "Ps" Line(s) [default: 1] (DL)
793
794     "ESC [ Ps P"
795         Delete "Ps" Character(s) [default: 1] (DCH)
796
797     "ESC [ Ps;Ps;Ps;Ps;Ps T"
798         Initiate . *unimplemented* Parameters are
799         [func;startx;starty;firstrow;lastrow].
800
801     "ESC [ Ps W"
802         Tabulator functions
803
804            Ps = 0          Tab Set (HTS)   
805            Ps = 2          Tab Clear (TBC), Clear Current Column (default) 
806            Ps = 5          Tab Clear (TBC), Clear All 
807
808     "ESC [ Ps X"
809         Erase "Ps" Character(s) [default: 1] (ECH)
810
811     "ESC [ Ps Z"
812         Move backward "Ps" [default: 1] tab stops
813
814     "ESC [ Ps '"
815         See "ESC [ Ps G"
816
817     "ESC [ Ps a"
818         See "ESC [ Ps C"
819
820     "ESC [ Ps c"
821         Send Device Attributes (DA) "Ps = 0" (or omitted): request
822         attributes from terminal returns: "ESC[?1;2c" (``I am a VT100 with
823         Advanced Video Option'')
824
825     "ESC [ Ps d"
826         Cursor to Line "Ps" (VPA)
827
828     "ESC [ Ps e"
829         See "ESC [ Ps A"
830
831     "ESC [ Ps;Ps f"
832         Horizontal and Vertical Position [row;column] (HVP) [default: 1;1]
833
834     "ESC [ Ps g"
835         Tab Clear (TBC)
836
837            Ps = 0          Clear Current Column (default) 
838            Ps = 3          Clear All (TBC) 
839
840     "ESC [ Pm h"
841         Set Mode (SM). See "ESC [ Pm l" sequence for description of "Pm".
842
843     "ESC [ Ps i"
844         Printing. See also the "print-pipe" resource.
845
846            Ps = 0          print screen (MC0) 
847            Ps = 4          disable transparent print mode (MC4) 
848            Ps = 5          enable transparent print mode (MC5) 
849
850     "ESC [ Pm l"
851         Reset Mode (RM)
852
853         "Ps = 4"
854                h               Insert Mode (SMIR) 
855                l               Replace Mode (RMIR) 
856
857         "Ps = 20" (partially implemented)
858                h               Automatic Newline (LNM) 
859                l               Normal Linefeed (LNM) 
860
861     "ESC [ Pm m"
862         Character Attributes (SGR)
863
864            Ps = 0          Normal (default) 
865            Ps = 1 / 21     On / Off Bold (bright fg) 
866            Ps = 3 / 23     On / Off Italic 
867            Ps = 4 / 24     On / Off Underline 
868            Ps = 5 / 25     On / Off Slow Blink (bright bg) 
869            Ps = 6 / 26     On / Off Rapid Blink (bright bg) 
870            Ps = 7 / 27     On / Off Inverse 
871            Ps = 8 / 27     On / Off Invisible (NYI) 
872            Ps = 30 / 40    fg/bg Black     
873            Ps = 31 / 41    fg/bg Red       
874            Ps = 32 / 42    fg/bg Green     
875            Ps = 33 / 43    fg/bg Yellow    
876            Ps = 34 / 44    fg/bg Blue      
877            Ps = 35 / 45    fg/bg Magenta   
878            Ps = 36 / 46    fg/bg Cyan      
879            Ps = 38;5 / 48;5 set fg/bg to color #m (ISO 8613-6) 
880            Ps = 37 / 47    fg/bg White     
881            Ps = 39 / 49    fg/bg Default   
882            Ps = 90 / 100   fg/bg Bright Black 
883            Ps = 91 / 101   fg/bg Bright Red 
884            Ps = 92 / 102   fg/bg Bright Green 
885            Ps = 93 / 103   fg/bg Bright Yellow 
886            Ps = 94 / 104   fg/bg Bright Blue 
887            Ps = 95 / 105   fg/bg Bright Magenta 
888            Ps = 96 / 106   fg/bg Bright Cyan 
889            Ps = 97 / 107   fg/bg Bright White 
890            Ps = 99 / 109   fg/bg Bright Default 
891
892     "ESC [ Ps n"
893         Device Status Report (DSR)
894
895            Ps = 5          Status Report ESC [ 0 n (``OK'') 
896            Ps = 6          Report Cursor Position (CPR) [row;column] as ESC [ r ; c R 
897            Ps = 7          Request Display Name 
898            Ps = 8          Request Version Number (place in window title) 
899
900     "ESC [ Ps;Ps r"
901         Set Scrolling Region [top;bottom] [default: full size of window]
902         (CSR)
903
904     "ESC [ s"
905         Save Cursor (SC)
906
907     "ESC [ Ps;Pt t"
908         Window Operations
909
910            Ps = 1          Deiconify (map) window 
911            Ps = 2          Iconify window  
912            Ps = 3          ESC [ 3 ; X ; Y t Move window to (X|Y) 
913            Ps = 4          ESC [ 4 ; W ; H t Resize to WxH pixels 
914            Ps = 5          Raise window    
915            Ps = 6          Lower window    
916            Ps = 7          Refresh screen once 
917            Ps = 8          ESC [ 4 ; C ; R t Resize to C columns and R rows 
918            Ps = 11         Report window state (responds with Ps = 1 or Ps = 2 
919            Ps = 13         Report window position (responds with Ps = 3) 
920            Ps = 14         Report window pixel size (responds with Ps = 4) 
921            Ps = 18         Report window text size (responds with Ps = 7) 
922            Ps = 19         Currently the same as Ps = 18, but responds with Ps = 9 
923            Ps = 20         Reports icon label (ESC ] L NAME \234) 
924            Ps = 21         Reports window title (ESC ] l NAME \234) 
925            Ps = 24..       Set window height to Ps rows 
926
927     "ESC [ u"
928         Restore Cursor
929
930     "ESC [ Ps x"
931         Request Terminal Parameters (DECREQTPARM)
932
933
934
935 DEC Private Modes
936     "ESC [ ? Pm h"
937         DEC Private Mode Set (DECSET)
938
939     "ESC [ ? Pm l"
940         DEC Private Mode Reset (DECRST)
941
942     "ESC [ ? Pm r"
943         Restore previously saved DEC Private Mode Values.
944
945     "ESC [ ? Pm s"
946         Save DEC Private Mode Values.
947
948     "ESC [ ? Pm t"
949         Toggle DEC Private Mode Values (rxvt extension). *where*
950
951         "Ps = 1" (DECCKM)
952                h               Application Cursor Keys 
953                l               Normal Cursor Keys 
954
955         "Ps = 2" (ANSI/VT52 mode)
956                h               Enter VT52 mode 
957                l               Enter VT52 mode 
958
959         "Ps = 3"
960                h               132 Column Mode (DECCOLM) 
961                l               80 Column Mode (DECCOLM) 
962
963         "Ps = 4"
964                h               Smooth (Slow) Scroll (DECSCLM) 
965                l               Jump (Fast) Scroll (DECSCLM) 
966
967         "Ps = 5"
968                h               Reverse Video (DECSCNM) 
969                l               Normal Video (DECSCNM) 
970
971         "Ps = 6"
972                h               Origin Mode (DECOM) 
973                l               Normal Cursor Mode (DECOM) 
974
975         "Ps = 7"
976                h               Wraparound Mode (DECAWM) 
977                l               No Wraparound Mode (DECAWM) 
978
979         "Ps = 8" *unimplemented*
980                h               Auto-repeat Keys (DECARM) 
981                l               No Auto-repeat Keys (DECARM) 
982
983         "Ps = 9" X10 XTerm
984                h               Send Mouse X & Y on button press. 
985                l               No mouse reporting. 
986
987         "Ps = 10" (rxvt)
988                h               menuBar visible 
989                l               menuBar invisible 
990
991         "Ps = 25"
992                h               Visible cursor {cnorm/cvvis} 
993                l               Invisible cursor {civis} 
994
995         "Ps = 30"
996                h               scrollBar visisble 
997                l               scrollBar invisisble 
998
999         "Ps = 35" (rxvt)
1000                h               Allow XTerm Shift+key sequences 
1001                l               Disallow XTerm Shift+key sequences 
1002
1003         "Ps = 38" *unimplemented*
1004             Enter Tektronix Mode (DECTEK)
1005
1006         "Ps = 40"
1007                h               Allow 80/132 Mode 
1008                l               Disallow 80/132 Mode 
1009
1010         "Ps = 44" *unimplemented*
1011                h               Turn On Margin Bell 
1012                l               Turn Off Margin Bell 
1013
1014         "Ps = 45" *unimplemented*
1015                h               Reverse-wraparound Mode 
1016                l               No Reverse-wraparound Mode 
1017
1018         "Ps = 46" *unimplemented*
1019         "Ps = 47"
1020                h               Use Alternate Screen Buffer 
1021                l               Use Normal Screen Buffer 
1022
1023
1024
1025         "Ps = 66"
1026                h               Application Keypad (DECPAM) == ESC = 
1027                l               Normal Keypad (DECPNM) == ESC > 
1028
1029         "Ps = 67"
1030                h               Backspace key sends BS (DECBKM) 
1031                l               Backspace key sends DEL 
1032
1033         "Ps = 1000" (X11 XTerm)
1034                h               Send Mouse X & Y on button press and release. 
1035                l               No mouse reporting. 
1036
1037         "Ps = 1001" (X11 XTerm) *unimplemented*
1038                h               Use Hilite Mouse Tracking. 
1039                l               No mouse reporting. 
1040
1041         "Ps = 1010" (rxvt)
1042                h               Don't scroll to bottom on TTY output 
1043                l               Scroll to bottom on TTY output 
1044
1045         "Ps = 1011" (rxvt)
1046                h               Scroll to bottom when a key is pressed 
1047                l               Don't scroll to bottom when a key is pressed 
1048
1049         "Ps = 1047"
1050                h               Use Alternate Screen Buffer 
1051                l               Use Normal Screen Buffer - clear Alternate Screen Buffer if returning from it 
1052
1053         "Ps = 1048"
1054                h               Save cursor position 
1055                l               Restore cursor position 
1056
1057         "Ps = 1049"
1058                h               Use Alternate Screen Buffer - clear Alternate Screen Buffer if switching to it 
1059                l               Use Normal Screen Buffer 
1060
1061
1062
1063 XTerm Operating System Commands
1064     "ESC ] Ps;Pt ST"
1065         Set XTerm Parameters. 8-bit ST: 0x9c, 7-bit ST sequence: ESC \
1066         (0x1b, 0x5c), backwards compatible terminator BEL (0x07) is also
1067         accepted. any octet can be escaped by prefixing it with SYN (0x16,
1068         ^V).
1069
1070            Ps = 0          Change Icon Name and Window Title to Pt 
1071            Ps = 1          Change Icon Name to Pt 
1072            Ps = 2          Change Window Title to Pt 
1073            Ps = 3          If Pt starts with a ?, query the (STRING) property of the window and return it. If Pt contains a =, set the named property to the given value, else delete the specified property. 
1074            Ps = 4          Pt is a semi-colon separated sequence of one or more semi-colon separated number/name pairs, where number is an index to a colour and name is the name of a colour. Each pair causes the numbered colour to be changed to name. Numbers 0-7 corresponds to low-intensity (normal) colours and 8-15 corresponds to high-intensity colours. 0=black, 1=red, 2=green, 3=yellow, 4=blue, 5=magenta, 6=cyan, 7=white 
1075            Ps = 10         Change colour of text foreground to Pt (NB: may change in future) 
1076            Ps = 11         Change colour of text background to Pt (NB: may change in future) 
1077            Ps = 12         Change colour of text cursor foreground to Pt 
1078            Ps = 13         Change colour of mouse foreground to Pt 
1079            Ps = 17         Change colour of highlight characters to Pt 
1080            Ps = 18         Change colour of bold characters to Pt 
1081            Ps = 19         Change colour of underlined characters to Pt 
1082            Ps = 20         Change default background to Pt 
1083            Ps = 39         Change default foreground colour to Pt rxvt compile-time option 
1084            Ps = 46         Change Log File to Pt unimplemented 
1085            Ps = 49         Change default background colour to Pt rxvt compile-time option 
1086            Ps = 50         Set fontset to Pt, with the following special values of Pt (rxvt) #+n change up n #-n change down n if n is missing of 0, a value of 1 is used empty change to font0 n change to font n 
1087            Ps = 55         Log all scrollback buffer and all of screen to Pt 
1088            Ps = 701        Change current locale to Pt, or, if Pt is ?, return the current locale (rxvt extension) 
1089            Ps = 703        Menubar command Pt rxvt compile-time option (rxvt-unicode extension) 
1090            Ps = 704        Change colour of italic characters to Pt 
1091            Ps = 705        Change background pixmap tint colour to Pt 
1092            Ps = 710        Set normal fontset to Pt. Same as Ps = 50. 
1093            Ps = 711        Set bold fontset to Pt. Similar to Ps = 50. 
1094            Ps = 712        Set italic fontset to Pt. Similar to Ps = 50. 
1095            Ps = 713        Set bold-italic fontset to Pt. Similar to Ps = 50. 
1096
1097
1098
1099 menuBar
1100     The exact syntax used is *almost* solidified. In the menus, DON'T try to
1101     use menuBar commands that add or remove a menuBar.
1102
1103     Note that in all of the commands, the */path/* *cannot* be omitted: use
1104     ./ to specify a menu relative to the current menu.
1105
1106   Overview of menuBar operation
1107     For the menuBar XTerm escape sequence "ESC ] 703 ; Pt ST", the syntax of
1108     "Pt" can be used for a variety of tasks:
1109
1110     At the top level is the current menuBar which is a member of a circular
1111     linked-list of other such menuBars.
1112
1113     The menuBar acts as a parent for the various drop-down menus, which in
1114     turn, may have labels, separator lines, menuItems and subMenus.
1115
1116     The menuItems are the useful bits: you can use them to mimic keyboard
1117     input or even to send text or escape sequences back to rxvt.
1118
1119     The menuBar syntax is intended to provide a simple yet robust method of
1120     constructing and manipulating menus and navigating through the menuBars.
1121
1122     The first step is to use the tag [menu:*name*] which creates the menuBar
1123     called *name* and allows access. You may now or menus, subMenus, and
1124     menuItems. Finally, use the tag [done] to set the menuBar access as
1125     readonly to prevent accidental corruption of the menus. To re-access the
1126     current menuBar for alterations, use the tag [menu], make the
1127     alterations and then use [done]
1128
1129
1130
1131   Commands
1132     [menu:+*name*]
1133         access the named menuBar for creation or alteration. If a new
1134         menuBar is created, it is called *name* (max of 15 chars) and the
1135         current menuBar is pushed onto the stack
1136
1137     [menu]
1138         access the current menuBar for alteration
1139
1140     [title:+*string*]
1141         set the current menuBar's title to *string*, which may contain the
1142         following format specifiers: %% : literal % character %n : rxvt name
1143         (as per the -name command-line option) %v : rxvt version
1144
1145     [done]
1146         set menuBar access as readonly. End-of-file tag for [read:+*file*]
1147         operations.
1148
1149     [read:+*file*]
1150         read menu commands directly from *file* (extension ".menu" will be
1151         appended if required.) Start reading at a line with [menu] or
1152         [menu:+*name* and continuing until [done] is encountered.
1153
1154         Blank and comment lines (starting with #) are ignored. Actually,
1155         since any invalid menu commands are also ignored, almost anything
1156         could be construed as a comment line, but this may be tightened up
1157         in the future ... so don't count on it!.
1158
1159     [read:+*file*;+*name*]
1160         The same as [read:+*file*], but start reading at a line with
1161         [menu:+*name*] and continuing until [done:+*name*] or [done] is
1162         encountered.
1163
1164     [dump]
1165         dump all menuBars to the file /tmp/rxvt-PID in a format suitable for
1166         later rereading.
1167
1168     [rm:name]
1169         remove the named menuBar
1170
1171     [rm] [rm:]
1172         remove the current menuBar
1173
1174     [rm*] [rm:*]
1175         remove all menuBars
1176
1177     [swap]
1178         swap the top two menuBars
1179
1180     [prev]
1181         access the previous menuBar
1182
1183     [next]
1184         access the next menuBar
1185
1186     [show]
1187         Enable display of the menuBar
1188
1189     [hide]
1190         Disable display of the menuBar
1191
1192     [pixmap:+*name*]
1193     [pixmap:+*name*;*scaling*]
1194         (set the background pixmap globally
1195
1196         A Future implementation *may* make this local to the menubar)
1197
1198     [:+*command*:]
1199         ignore the menu readonly status and issue a *command* to or a menu
1200         or menuitem or change the ; a useful shortcut for setting the quick
1201         arrows from a menuBar.
1202
1203
1204
1205   Adding and accessing menus
1206     The following commands may also be + prefixed.
1207
1208     /+  access menuBar top level
1209
1210     ./+ access current menu level
1211
1212     ../+
1213         access parent menu (1 level up)
1214
1215     ../../
1216         access parent menu (multiple levels up)
1217
1218     */path/*menu
1219         add/access menu
1220
1221     */path/*menu/*
1222         add/access menu and clear it if it exists
1223
1224     */path/*{-}
1225         add separator
1226
1227     */path/*{item}
1228         add item as a label
1229
1230     */path/*{item} action
1231         add/alter *menuitem* with an associated *action*
1232
1233     */path/*{item}{right-text}
1234         add/alter *menuitem* with right-text as the right-justified text and
1235         as the associated *action*
1236
1237     */path/*{item}{rtext} action
1238         add/alter *menuitem* with an associated *action* and with rtext as
1239         the right-justified text.
1240
1241     Special characters in *action* must be backslash-escaped:
1242         \a \b \E \e \n \r \t \octal
1243
1244     or in control-character notation:
1245         ^@, ^A .. ^Z .. ^_, ^?
1246
1247     To send a string starting with a NUL (^@) character to the program,
1248     start *action* with a pair of NUL characters (^@^@), the first of which
1249     will be stripped off and the balance directed to the program. Otherwise
1250     if *action* begins with NUL followed by non-+NUL characters, the leading
1251     NUL is stripped off and the balance is sent back to rxvt.
1252
1253     As a convenience for the many Emacs-type editors, *action* may start
1254     with M- (eg, M-$ is equivalent to \E$) and a CR will be appended if
1255     missed from M-x commands.
1256
1257     As a convenience for issuing XTerm ESC] sequences from a menubar (or
1258     quick arrow), a BEL (^G) will be appended if needed.
1259
1260     For example,
1261         M-xapropos is equivalent to \Exapropos\r
1262
1263     and \E]703;mona;100 is equivalent to \E]703;mona;100\a
1264
1265     The option {*right-rtext*} will be right-justified. In the absence of a
1266     specified action, this text will be used as the *action* as well.
1267
1268     For example,
1269         /File/{Open}{^X^F} is equivalent to /File/{Open}{^X^F} ^X^F
1270
1271     The left label *is* necessary, since it's used for matching, but
1272     implicitly hiding the left label (by using same name for both left and
1273     right labels), or explicitly hiding the left label (by preceeding it
1274     with a dot), makes it possible to have right-justified text only.
1275
1276     For example,
1277         /File/{Open}{Open} Open-File-Action
1278
1279     or hiding it
1280         /File/{.anylabel}{Open} Open-File-Action
1281
1282
1283
1284   Removing menus
1285     -/*+
1286         remove all menus from the menuBar, the same as [clear]
1287
1288     -+*/path*menu+
1289         remove menu
1290
1291     -+*/path*{item}+
1292         remove item
1293
1294     -+*/path*{-}
1295         remove separator)
1296
1297     -/path/menu/*
1298         remove all items, separators and submenus from menu
1299
1300
1301
1302   Quick Arrows
1303     The menus also provide a hook for *quick arrows* to provide easier user
1304     access. If nothing has been explicitly set, the default is to emulate
1305     the curror keys. The syntax permits each arrow to be altered
1306     individually or all four at once without re-entering their common
1307     beginning/end text. For example, to explicitly associate cursor actions
1308     with the arrows, any of the following forms could be used:
1309
1310     <r>+*Right*
1311     <l>+*Left*
1312     <u>+*Up*
1313     <d>+*Down*
1314         Define actions for the respective arrow buttons
1315
1316     <b>+*Begin*
1317     <e>+*End*
1318         Define common beginning/end parts for *quick arrows* which used in
1319         conjunction with the above <r> <l> <u> <d> constructs
1320
1321     For example, define arrows individually,
1322          <u>\E[A
1323
1324          <d>\E[B
1325
1326          <r>\E[C
1327
1328          <l>\E[D
1329
1330     or all at once
1331          <u>\E[AZ<><d>\E[BZ<><r>\E[CZ<><l>\E[D
1332
1333     or more compactly (factoring out common parts)
1334          <b>\E[<u>AZ<><d>BZ<><r>CZ<><l>D
1335
1336
1337
1338   Command Summary
1339     A short summary of the most *common* commands:
1340
1341     [menu:name]
1342         use an existing named menuBar or start a new one
1343
1344     [menu]
1345         use the current menuBar
1346
1347     [title:string]
1348         set menuBar title
1349
1350     [done]
1351         set menu access to readonly and, if reading from a file, signal EOF
1352
1353     [done:name]
1354         if reading from a file using [read:file;name] signal EOF
1355
1356     [rm:name]
1357         remove named menuBar(s)
1358
1359     [rm] [rm:]
1360         remove current menuBar
1361
1362     [rm*] [rm:*]
1363         remove all menuBar(s)
1364
1365     [swap]
1366         swap top two menuBars
1367
1368     [prev]
1369         access the previous menuBar
1370
1371     [next]
1372         access the next menuBar
1373
1374     [show]
1375         map menuBar
1376
1377     [hide]
1378         unmap menuBar
1379
1380     [pixmap;file]
1381     [pixmap;file;scaling]
1382         set a background pixmap
1383
1384     [read:file]
1385     [read:file;name]
1386         read in a menu from a file
1387
1388     [dump]
1389         dump out all menuBars to /tmp/rxvt-PID
1390
1391     /   access menuBar top level
1392
1393     ./
1394     ../
1395     ../../
1396         access current or parent menu level
1397
1398     /path/menu
1399         add/access menu
1400
1401     /path/{-}
1402         add separator
1403
1404     /path/{item}{rtext} action
1405         add/alter menu item
1406
1407     -/* remove all menus from the menuBar
1408
1409     -/path/menu
1410         remove menu items, separators and submenus from menu
1411
1412     -/path/menu
1413         remove menu
1414
1415     -/path/{item}
1416         remove item
1417
1418     -/path/{-}
1419         remove separator
1420
1421     <b>Begin<r>Right<l>Left<u>Up<d>Down<e>End
1422         menu quick arrows
1423
1424 XPM
1425     For the XPM XTerm escape sequence "ESC ] 20 ; Pt ST" then value of "Pt"
1426     can be the name of the background pixmap followed by a sequence of
1427     scaling/positioning commands separated by semi-colons. The
1428     scaling/positioning commands are as follows:
1429
1430     query scale/position
1431         ?
1432
1433     change scale and position
1434         WxH+X+Y
1435
1436         WxH+X (== WxH+X+X)
1437
1438         WxH (same as WxH+50+50)
1439
1440         W+X+Y (same as WxW+X+Y)
1441
1442         W+X (same as WxW+X+X)
1443
1444         W (same as WxW+50+50)
1445
1446     change position (absolute)
1447         =+X+Y
1448
1449         =+X (same as =+X+Y)
1450
1451     change position (relative)
1452         +X+Y
1453
1454         +X (same as +X+Y)
1455
1456     rescale (relative)
1457         Wx0 -> W *= (W/100)
1458
1459         0xH -> H *= (H/100)
1460
1461     For example:
1462
1463     \E]20;funky\a
1464         load funky.xpm as a tiled image
1465
1466     \E]20;mona;100\a
1467         load mona.xpm with a scaling of 100%
1468
1469     \E]20;;200;?\a
1470         rescale the current pixmap to 200% and display the image geometry in
1471         the title
1472
1473 Mouse Reporting
1474     "ESC [ M <b> <x> <y>"
1475         report mouse position
1476
1477     The lower 2 bits of "<b>" indicate the button:
1478
1479     Button = "(<b> - SPACE) & 3"
1480            0               Button1 pressed 
1481            1               Button2 pressed 
1482            2               Button3 pressed 
1483            3               button released (X11 mouse report) 
1484
1485     The upper bits of "<b>" indicate the modifiers when the button was
1486     pressed and are added together (X11 mouse report only):
1487
1488     State = "(<b> - SPACE) & 60"
1489            4               Shift           
1490            8               Meta            
1491            16              Control         
1492            32              Double Click (Rxvt extension) 
1493
1494         Col = "<x> - SPACE"
1495
1496         Row = "<y> - SPACE"
1497
1498 Key Codes
1499     Note: Shift + F1-F10 generates F11-F20
1500
1501     For the keypad, use Shift to temporarily override Application-Keypad
1502     setting use Num_Lock to toggle Application-Keypad setting if Num_Lock is
1503     off, toggle Application-Keypad setting. Also note that values of Home,
1504     End, Delete may have been compiled differently on your system.
1505
1506                        Normal          Shift           Control         Ctrl+Shift      
1507        Tab             ^I              ESC [ Z         ^I              ESC [ Z         
1508        BackSpace       ^H              ^?              ^?              ^?              
1509        Find            ESC [ 1 ~       ESC [ 1 $       ESC [ 1 ^       ESC [ 1 @       
1510        Insert          ESC [ 2 ~       paste           ESC [ 2 ^       ESC [ 2 @       
1511        Execute         ESC [ 3 ~       ESC [ 3 $       ESC [ 3 ^       ESC [ 3 @       
1512        Select          ESC [ 4 ~       ESC [ 4 $       ESC [ 4 ^       ESC [ 4 @       
1513        Prior           ESC [ 5 ~       scroll-up       ESC [ 5 ^       ESC [ 5 @       
1514        Next            ESC [ 6 ~       scroll-down     ESC [ 6 ^       ESC [ 6 @       
1515        Home            ESC [ 7 ~       ESC [ 7 $       ESC [ 7 ^       ESC [ 7 @       
1516        End             ESC [ 8 ~       ESC [ 8 $       ESC [ 8 ^       ESC [ 8 @       
1517        Delete          ESC [ 3 ~       ESC [ 3 $       ESC [ 3 ^       ESC [ 3 @       
1518        F1              ESC [ 11 ~      ESC [ 23 ~      ESC [ 11 ^      ESC [ 23 ^      
1519        F2              ESC [ 12 ~      ESC [ 24 ~      ESC [ 12 ^      ESC [ 24 ^      
1520        F3              ESC [ 13 ~      ESC [ 25 ~      ESC [ 13 ^      ESC [ 25 ^      
1521        F4              ESC [ 14 ~      ESC [ 26 ~      ESC [ 14 ^      ESC [ 26 ^      
1522        F5              ESC [ 15 ~      ESC [ 28 ~      ESC [ 15 ^      ESC [ 28 ^      
1523        F6              ESC [ 17 ~      ESC [ 29 ~      ESC [ 17 ^      ESC [ 29 ^      
1524        F7              ESC [ 18 ~      ESC [ 31 ~      ESC [ 18 ^      ESC [ 31 ^      
1525        F8              ESC [ 19 ~      ESC [ 32 ~      ESC [ 19 ^      ESC [ 32 ^      
1526        F9              ESC [ 20 ~      ESC [ 33 ~      ESC [ 20 ^      ESC [ 33 ^      
1527        F10             ESC [ 21 ~      ESC [ 34 ~      ESC [ 21 ^      ESC [ 34 ^      
1528        F11             ESC [ 23 ~      ESC [ 23 $      ESC [ 23 ^      ESC [ 23 @      
1529        F12             ESC [ 24 ~      ESC [ 24 $      ESC [ 24 ^      ESC [ 24 @      
1530        F13             ESC [ 25 ~      ESC [ 25 $      ESC [ 25 ^      ESC [ 25 @      
1531        F14             ESC [ 26 ~      ESC [ 26 $      ESC [ 26 ^      ESC [ 26 @      
1532        F15 (Help)      ESC [ 28 ~      ESC [ 28 $      ESC [ 28 ^      ESC [ 28 @      
1533        F16 (Menu)      ESC [ 29 ~      ESC [ 29 $      ESC [ 29 ^      ESC [ 29 @      
1534        F17             ESC [ 31 ~      ESC [ 31 $      ESC [ 31 ^      ESC [ 31 @      
1535        F18             ESC [ 32 ~      ESC [ 32 $      ESC [ 32 ^      ESC [ 32 @      
1536        F19             ESC [ 33 ~      ESC [ 33 $      ESC [ 33 ^      ESC [ 33 @      
1537        F20             ESC [ 34 ~      ESC [ 34 $      ESC [ 34 ^      ESC [ 34 @      
1538                                                                        Application     
1539        Up              ESC [ A         ESC [ a         ESC O a         ESC O A         
1540        Down            ESC [ B         ESC [ b         ESC O b         ESC O B         
1541        Right           ESC [ C         ESC [ c         ESC O c         ESC O C         
1542        Left            ESC [ D         ESC [ d         ESC O d         ESC O D         
1543        KP_Enter        ^M                                              ESC O M         
1544        KP_F1           ESC O P                                         ESC O P         
1545        KP_F2           ESC O Q                                         ESC O Q         
1546        KP_F3           ESC O R                                         ESC O R         
1547        KP_F4           ESC O S                                         ESC O S         
1548        XK_KP_Multiply  *                                               ESC O j         
1549        XK_KP_Add       +                                               ESC O k         
1550        XK_KP_Separator ,                                               ESC O l         
1551        XK_KP_Subtract  -                                               ESC O m         
1552        XK_KP_Decimal   .                                               ESC O n         
1553        XK_KP_Divide    /                                               ESC O o         
1554        XK_KP_0         0                                               ESC O p         
1555        XK_KP_1         1                                               ESC O q         
1556        XK_KP_2         2                                               ESC O r         
1557        XK_KP_3         3                                               ESC O s         
1558        XK_KP_4         4                                               ESC O t         
1559        XK_KP_5         5                                               ESC O u         
1560        XK_KP_6         6                                               ESC O v         
1561        XK_KP_7         7                                               ESC O w         
1562        XK_KP_8         8                                               ESC O x         
1563        XK_KP_9         9                                               ESC O y         
1564
1565 CONFIGURE OPTIONS
1566     General hint: if you get compile errors, then likely your configuration
1567     hasn't been tested well. Either try with --enable-everything or use the
1568     ./reconf script as a base for experiments. ./reconf is used by myself,
1569     so it should generally be a working config. Of course, you should always
1570     report when a combination doesn't work, so it can be fixed. Marc Lehmann
1571     <rxvt@schmorp.de>.
1572
1573     --enable-everything
1574         Add support for all non-multichoice options listed in "./configure
1575         --help". Note that unlike other enable options this is order
1576         dependant. You can specify this and then disable options which this
1577         enables by *following* this with the appropriate commands.
1578
1579     --enable-xft
1580         Add support for Xft (anti-aliases, among others) fonts. Xft fonts
1581         are slower and require lots of memory, but as long as you don't use
1582         them, you don't pay for them.
1583
1584     --enable-font-styles
1585         Add support for bold, *italic* and *bold italic* font styles. The
1586         fonts can be set manually or automatically.
1587
1588     --with-codesets=NAME,...
1589         Compile in support for additional codeset (encoding) groups (eu, vn
1590         are always compiled in, which includes most 8-bit character sets).
1591         These codeset tables are currently only used for driving X11 core
1592         fonts, they are not required for Xft fonts. Compiling them in will
1593         make your binary bigger (together about 700kB), but it doesn't
1594         increase memory usage unless you use an X11 font requiring one of
1595         these encodings.
1596
1597            all             all available codeset groups 
1598            zh              common chinese encodings 
1599            zh_ext          rarely used but very big chinese encodigs 
1600            jp              common japanese encodings 
1601            jp_ext          rarely used but big japanese encodings 
1602            kr              korean encodings 
1603
1604     --enable-xim
1605         Add support for XIM (X Input Method) protocol. This allows using
1606         alternative input methods (e.g. kinput2) and will also correctly set
1607         up the input for people using dead keys or compose keys.
1608
1609     --enable-unicode3
1610         Enable direct support for displaying unicode codepoints above 65535
1611         (the basic multilingual page). This increases storage requirements
1612         per character from 2 to 4 bytes. X11 fonts do not yet support these
1613         extra characters, but Xft does.
1614
1615         Please note that rxvt-unicode can store unicode code points >65535
1616         even without this flag, but the number of such characters is limited
1617         to a view thousand (shared with combining characters, see next
1618         switch), and right now rxvt-unicode cannot display them
1619         (input/output and cut&paste still work, though).
1620
1621     --enable-combining
1622         Enable automatic composition of combining characters into composite
1623         characters. This is required for proper viewing of text where
1624         accents are encoded as seperate unicode characters. This is done by
1625         using precomposited characters when available or creating new
1626         pseudo-characters when no precomposed form exists.
1627
1628         Without --enable-unicode3, the number of additional precomposed
1629         characters is rather limited (2048, if this is full, rxvt will use
1630         the private use area, extending the number of combinations to 8448).
1631         With --enable-unicode3, no practical limit exists. This will also
1632         enable storage of characters >65535.
1633
1634         The combining table also contains entries for arabic presentation
1635         forms, but these are not currently used. Bug me if you want these to
1636         be used.
1637
1638     --enable-fallback(=CLASS)
1639         When reading resource settings, also read settings for class CLASS
1640         (default: Rxvt). To disable resource fallback use
1641         --disable-fallback.
1642
1643     --with-res-name=NAME
1644         Use the given name (default: urxvt) as default application name when
1645         reading resources. Specify --with-res-name=rxvt to replace rxvt.
1646
1647     --with-res-class=CLASS
1648         Use the given class (default: URxvt) as default application class
1649         when reading resources. Specify --with-res-class=Rxvt to replace
1650         rxvt.
1651
1652     --enable-utmp
1653         Write user and tty to utmp file (used by programs like w) at start
1654         of rxvt execution and delete information when rxvt exits.
1655
1656     --enable-wtmp
1657         Write user and tty to wtmp file (used by programs like last) at
1658         start of rxvt execution and write logout when rxvt exits. This
1659         option requires --enable-utmp to also be specified.
1660
1661     --enable-lastlog
1662         Write user and tty to lastlog file (used by programs like lastlogin)
1663         at start of rxvt execution. This option requires --enable-utmp to
1664         also be specified.
1665
1666     --enable-xpm-background
1667         Add support for XPM background pixmaps.
1668
1669     --enable-transparency
1670         Add support for inheriting parent backgrounds thus giving a fake
1671         transparency to the term.
1672
1673     --enable-fading
1674         Add support for fading the text when focus is lost.
1675
1676     --enable-tinting
1677         Add support for tinting of transparent backgrounds.
1678
1679     --enable-menubar
1680         Add support for our menu bar system (this interacts badly with
1681         dynamic locale switching currently).
1682
1683     --enable-rxvt-scroll
1684         Add support for the original rxvt scrollbar.
1685
1686     --enable-next-scroll
1687         Add support for a NeXT-like scrollbar.
1688
1689     --enable-xterm-scroll
1690         Add support for an Xterm-like scrollbar.
1691
1692     --enable-plain-scroll
1693         Add support for a very unobtrusive, plain-looking scrollbar that is
1694         the favourite of the rxvt-unicode author, having used it for many
1695         years.
1696
1697     --enable-half-shadow
1698         Make shadows on the scrollbar only half the normal width & height.
1699         only applicable to rxvt scrollbars.
1700
1701     --enable-ttygid
1702         Change tty device setting to group "tty" - only use this if your
1703         system uses this type of security.
1704
1705     --disable-backspace-key
1706         Disable any handling of the backspace key by us - let the X server
1707         do it.
1708
1709     --disable-delete-key
1710         Disable any handling of the delete key by us - let the X server do
1711         it.
1712
1713     --disable-resources
1714         Remove all resources checking.
1715
1716     --enable-xgetdefault
1717         Make resources checking via XGetDefault() instead of our small
1718         version which only checks ~/.Xdefaults, or if that doesn't exist
1719         then ~/.Xresources.
1720
1721     --enable-strings
1722         Add support for our possibly faster memset() function and other
1723         various routines, overriding your system's versions which may have
1724         been hand-crafted in assembly or may require extra libraries to link
1725         in. (this breaks ANSI-C rules and has problems on many GNU/Linux
1726         systems).
1727
1728     --disable-swapscreen
1729         Remove support for swap screen.
1730
1731     --enable-frills
1732         Add support for many small features that are not essential but nice
1733         to have. Normally you want this, but for very small binaries you may
1734         want to disable this.
1735
1736         A non-exhaustive list of features enabled by "--enable-frills"
1737         (possibly in combination with other switches) is:
1738
1739           MWM-hints
1740           seperate underline colour
1741           settable border widths and borderless switch
1742           settable extra linespacing
1743           extra window properties (e.g. UTF-8 window names and PID)
1744           iso-14755-2 and -3, and visual feedback
1745           backindex and forwardindex escape sequence
1746           window op and locale change escape sequences
1747           tripleclickwords
1748           settable insecure mode
1749
1750     --enable-iso14755
1751         Enable extended ISO 14755 support (see rxvt(1), or doc/rxvt.1.txt).
1752         Basic support (section 5.1) is enabled by "--enable-frills", while
1753         support for 5.2, 5.3 and 5.4 is enabled with this switch.
1754
1755     --enable-keepscrolling
1756         Add support for continual scrolling of the display when you hold the
1757         mouse button down on a scrollbar arrow.
1758
1759     --enable-mousewheel
1760         Add support for scrolling via mouse wheel or buttons 4 & 5.
1761
1762     --enable-slipwheeling
1763         Add support for continual scrolling (using the mouse wheel as an
1764         accelerator) while the control key is held down. This option
1765         requires --enable-mousewheel to also be specified.
1766
1767     --disable-new-selection
1768         Remove support for mouse selection style like that of xterm.
1769
1770     --enable-dmalloc
1771         Use Gray Watson's malloc - which is good for debugging See
1772         http://www.letters.com/dmalloc/ for details If you use either this
1773         or the next option, you may need to edit src/Makefile after
1774         compiling to point DINCLUDE and DLIB to the right places.
1775
1776         You can only use either this option and the following (should you
1777         use either) .
1778
1779     --enable-dlmalloc
1780         Use Doug Lea's malloc - which is good for a production version See
1781         <http://g.oswego.edu/dl/html/malloc.html> for details.
1782
1783     --enable-smart-resize
1784         Add smart growth/shrink behaviour when changing font size via from
1785         hot keys. This should keep in a fixed position the rxvt corner which
1786         is closest to a corner of the screen.
1787
1788     --enable-cursor-blink
1789         Add support for a blinking cursor.
1790
1791     --enable-pointer-blank
1792         Add support to have the pointer disappear when typing or inactive.
1793
1794     --with-name=NAME
1795         Set the basename for the installed binaries (default: "urxvt",
1796         resulting in "urxvt", "urxvtd" etc.). Specify "--with-name=rxvt" to
1797         replace with "rxvt".
1798
1799     --with-term=NAME
1800         Change the environmental variable for the terminal to NAME (default
1801         "rxvt-unicode")
1802
1803     --with-terminfo=PATH
1804         Change the environmental variable for the path to the terminfo tree
1805         to PATH.
1806
1807     --with-x
1808         Use the X Window System (pretty much default, eh?).
1809
1810     --with-xpm-includes=DIR
1811         Look for the XPM includes in DIR.
1812
1813     --with-xpm-library=DIR
1814         Look for the XPM library in DIR.
1815
1816     --with-xpm
1817         Not needed - define via --enable-xpm-background.
1818
1819 AUTHORS
1820     Marc Lehmann <rxvt@schmorp.de> converted this document to pod and
1821     reworked it from the original Rxvt documentation, which was done by
1822     Geoff Wing <gcw@pobox.com>, who in turn used the XTerm documentation and
1823     other sources.
1824