FAQ 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  1. --------------------------------------------------------------------------
  2. FAQ
  3. --------------------------------------------------------------------------
  4. -----
  5. Q: How do I know which rxvt version I'm using?
  6. A: The version number is displayed with the usage (-h).
  7. For rxvt version 2.14 and later, the escape sequence `ESC[8n'
  8. sets the window title to the version number.
  9. -----
  10. Q: Mouse cut/paste suddenly no longer works.
  11. A: Make sure that mouse reporting is actually turned off since
  12. killing some editors prematurely may leave the mouse in mouse
  13. report mode. I've heard that tcsh may use mouse reporting
  14. unless it otherwise specified. A quick check is to see if
  15. cut/paste works when the Alt or Shift keys are depressed. See
  16. doc/refer.txt
  17. -----
  18. Q: What's with this bold/blink stuff? I can never get blinking text!
  19. A: It is not possible, and likely will never be, for rxvt to have
  20. actual blinking text. Instead (if rxvt was compiled without
  21. NO_BOLDCOLOR), bold/blink attributes are used to set high-intensity
  22. foreground/background colors ... like what you'd see on a PC video
  23. adapter. There are programs, notably John Davis' SLang-based ones
  24. <ftp://space.mit.edu/pub/davis>, that use bold/blink attributes to
  25. permit 16 colors.
  26. color0-7 are the low-intensity colors.
  27. color8-15 are the corresponding high-intensity colors.
  28. A side issue of this bold/blink stuff is the question of how the
  29. normal default foreground/background colors are to be treated. If
  30. the default foreground/background match one of the low-intensity
  31. colors (color0-7), the bold/blink attribute will invoke the
  32. appropriate high-intensity color (color8-15).
  33. In the case that the default foreground doesn't match one of the
  34. low-intensity colors, the bold attribute will use an `overstrike'
  35. to simulate a bold font. But note this leaves pixel-droppings and
  36. so, rather than wasting an inordinate amounts of energy to fix it,
  37. its use is simply deprecated.
  38. In the case that the default background doesn't match one of the
  39. low-intensity colors, the blink attribute is simply ignored
  40. (rather than representing it as bold as xterm does).
  41. -----
  42. Q: I don't like the screen colors. How do I change them?
  43. A: You can change the screen colors at run-time using ~/.Xdefaults
  44. resources (or as long-options) ... see the man-page.
  45. Here are values that are supposed to resemble a VGA screen,
  46. including the murky brown that passes for low-intensity yellow:
  47. Rxvt*color0: #000000
  48. Rxvt*color1: #A80000
  49. Rxvt*color2: #00A800
  50. Rxvt*color3: #A8A800
  51. Rxvt*color4: #0000A8
  52. Rxvt*color5: #A800A8
  53. Rxvt*color6: #00A8A8
  54. Rxvt*color7: #A8A8A8
  55. Rxvt*color8: #000054
  56. Rxvt*color9: #FF0054
  57. Rxvt*color10: #00FF54
  58. Rxvt*color11: #FFFF54
  59. Rxvt*color12: #0000FF
  60. Rxvt*color13: #FF00FF
  61. Rxvt*color14: #00FFFF
  62. Rxvt*color15: #FFFFFF
  63. -----
  64. Q: What's with the strange Backspace/Delete key behaviour?
  65. A: Assuming that the physical Backspace key corresponds to the
  66. BackSpace keysym (not likely for Linux ... see the following
  67. question) there are two standard values that can be used for
  68. Backspace: ^H and ^?.
  69. Rxvt tries to inherit the current stty settings and uses the value
  70. of `erase' to guess the value for backspace. If rxvt wasn't started
  71. from a terminal (say, from a menu or by remote shell), then the
  72. system value of `erase', which corresponds to CERASE in <termios.h>,
  73. will be used (which may not be the same as your stty setting).
  74. For starting a new rxvt:
  75. use Backspace = ^H
  76. $ stty erase ^H
  77. $ rxvt
  78. use Backspace = ^?
  79. $ stty erase ^?
  80. $ rxvt
  81. NB: generate either value with BackSpace and Ctrl/Shift-BackSpace.
  82. Toggle with "ESC[36h" / "ESC[36l" as documented in "doc/refer.txt"
  83. For an existing rxvt:
  84. use Backspace = ^H
  85. $ stty erase ^H
  86. $ echo -n "^[[36h"
  87. use Backspace = ^?
  88. $ stty erase ^?
  89. $ echo -n "^[[36l"
  90. This helps satisfy some of the Backspace discrepancies that occur,
  91. but if you use Backspace = ^?, make sure that the termcap/terminfo
  92. value properly reflects that.
  93. The Delete key (which one would expect to emit ^?) is a another
  94. casualty of the ill-defined Backspace problem. To avoid confusion
  95. between the Backspace and Delete keys, the Delete key has been
  96. assigned an escape sequence to match the vt100 for Execute (ESC[3~)
  97. and is in the supplied termcap/terminfo.
  98. Some other Backspace problems:
  99. some editors use termcap/terminfo,
  100. some editors (vim I'm told) expect Backspace = ^H,
  101. GNU Emacs (and Emacs-like editors) use ^H for help.
  102. Perhaps someday this will all be resolved in a consistent manner
  103. ... and maybe xterm will have Home/End values too!
  104. -----
  105. Q: Why doesn't the Backspace key work on my Linux machine?
  106. A: The XFree86 server has a notorious problem of mapping the Backspace
  107. key as Delete in order to match the Linux console.
  108. The correct way to fix this:
  109. 0 - Complain to your Linux distributer and the XFree86 team, maybe
  110. they'll fix it.
  111. 1 - Use xmodmap to correct the Backspace mapping
  112. ! ~/.Xmodmap
  113. ! a correctly-mapped BackSpace
  114. keycode 22 = BackSpace
  115. *** Make sure the keycode above matches the physical
  116. Backspace key on your machine!! (use xev) ***
  117. This will also fix the BackSpace problem with Motif applications,
  118. such as ``why doesn't Backspace work for Netscape?''
  119. You now have a Backspace key that functions as described in the
  120. previous question.
  121. 1a - You may also want to fix the regular xterm if it doesn't
  122. generates the desired value for BackSpace
  123. xterm*vt100.translations: #override \
  124. <Key>BackSpace: string(\010) \n
  125. or
  126. xterm*vt100.translations: #override \
  127. <Key>BackSpace: string(\177) \n
  128. while you are at it, you may also want to have consistent
  129. values to Home/End/Delete
  130. xterm*vt100.translations: #override \
  131. <Key>Home: string("\033[7~") \n\
  132. <Key>End: string("\033[8~") \n\
  133. <Key>Delete: string("\033[3~") \n
  134. Finally, you can also remap the rxvt key-binding at run-time (next
  135. question) but you'll lose the ability to have Ctrl/Shift-Backspace
  136. work differently as well as losing the escape sequence toggling of
  137. Backspace.
  138. -----
  139. Q: I don't like the key-bindings. How do I change them?
  140. A: There are some compile-time selections available via configure.
  141. Unless you have run "configure" with the "--disable-resources"
  142. option you can use the `keysym' resource to alter the keystrings
  143. associated with keysym 0xFF00 - 0xFFFF (function, cursor keys, etc).
  144. Here's an example for a tn3270 session started using
  145. `rxvt -name tn3270'
  146. !# ----- special uses ------:
  147. ! tn3270 login, remap function and arrow keys.
  148. tn3270*font: *clean-bold-*-*--15-*
  149. ! keysym - used by rxvt only
  150. ! Delete - ^D
  151. tn3270*keysym.0xFFFF: \004
  152. ! Home - ^A
  153. tn3270*keysym.0xFF50: \001
  154. ! Left - ^B
  155. tn3270*keysym.0xFF51: \002
  156. ! Up - ^P
  157. tn3270*keysym.0xFF52: \020
  158. ! Right - ^F
  159. tn3270*keysym.0xFF53: \006
  160. ! Down - ^N
  161. tn3270*keysym.0xFF54: \016
  162. ! End - ^E
  163. tn3270*keysym.0xFF57: \005
  164. ! F1 - F12
  165. tn3270*keysym.0xFFBE: \e1
  166. tn3270*keysym.0xFFBF: \e2
  167. tn3270*keysym.0xFFC0: \e3
  168. tn3270*keysym.0xFFC1: \e4
  169. tn3270*keysym.0xFFC2: \e5
  170. tn3270*keysym.0xFFC3: \e6
  171. tn3270*keysym.0xFFC4: \e7
  172. tn3270*keysym.0xFFC5: \e8
  173. tn3270*keysym.0xFFC6: \e9
  174. tn3270*keysym.0xFFC7: \e0
  175. tn3270*keysym.0xFFC8: \e-
  176. tn3270*keysym.0xFFC9: \e=
  177. ! map Prior/Next to F7/F8
  178. tn3270*keysym.0xFF55: \e7
  179. tn3270*keysym.0xFF56: \e8
  180. -----
  181. Q: I'm using keyboard model XXX that has extra Prior/Next/Insert keys.
  182. How do I make use of them? For example, the Sun Keyboard type 4
  183. has the following mappings that rxvt doesn't recognize.
  184. KP_Insert == Insert
  185. F22 == Print
  186. F27 == Home
  187. F29 == Prior
  188. F33 == End
  189. F35 == Next
  190. A: Rather than have rxvt try to accomodate all the various possible
  191. keyboard mappings, it is better to use `xmodmap' to remap the
  192. keys as required for your particular machine.
  193. -----
  194. Q: How do I distinguish if I'm running rxvt or a regular xterm?
  195. I need this to decide about setting colors etc.
  196. A: rxvt always exports the variable "COLORTERM", so you can check and
  197. see if that is set. Note that several programs, JED, slrn, Midnight
  198. Commander automatically check this variable to decide whether or not
  199. to use color.
  200. -----
  201. Q: How do I set the correct, full IP address for the DISPLAY variable?
  202. A: If you've compiled rxvt with DISPLAY_IS_IP then it is
  203. possible to use the following shell script snippets to correctly set
  204. the display. If your version of rxvt wasn't also compiled with
  205. ESCZ_ANSWER (as assumed in these snippets) then the COLORTERM
  206. variable can be used to distinguish rxvt from a regular xterm.
  207. Courtesy of Chuck Blake <cblake@BBN.COM> with the following shell
  208. script snippets:
  209. # Bourne/Korn/POSIX family of shells:
  210. [ ${TERM:-foo} = foo ] && TERM=xterm # assume an xterm if we don't know
  211. if [ ${TERM:-foo} = xterm ]; then
  212. stty -icanon -echo min 0 time 15 # see if enhanced rxvt or not
  213. echo -n '^[Z'
  214. read term_id
  215. stty icanon echo
  216. if [ ""${term_id} = '^[[?1;2C' -a ${DISPLAY:-foo} = foo ]; then
  217. echo -n '^[[7n' # query the rxvt we are in for the DISPLAY string
  218. read DISPLAY # set it in our local shell
  219. fi
  220. fi
  221. csh/tcsh family of shells:
  222. if ( !(${?TERM}) ) then # if term is unset, we are probably in an xterm
  223. TERM = xterm
  224. endif
  225. if ( ${TERM} =~ xterm ) then
  226. stty -icanon -echo min 0 time 15 # see if enhanced rxvt or not
  227. echo -n '^[Z'
  228. set term_id=$<
  229. stty icanon echo
  230. if ( ""${term_id} == "^[[?1;2C" && ${?DISPLAY} == 0 ) then
  231. echo -n '^[[7n' # query the rxvt we're in for the DISPLAY string
  232. setenv DISPLAY "$<" # set it in our local shell
  233. endif
  234. endif
  235. -----
  236. Q: How do I compile the manual pages for myself? Where do I obtain
  237. yodl from?
  238. A: You need to obtain yodl and compile it to make the manual pages
  239. from source. The source code for yodl can currently be obtained
  240. from http://www.xs4all.nl/~jantien/yodl/index.html
  241. --
  242. EOF